LifeMate — Personal, Family & Learning Companion
docs: record content and family lifecycle decisions [skip ci]
Quinn White committed
Oct 12, 2026 at 08:11 UTC
ec942249e0569ab020cf76eb82ada00c8a069b8c
14 files changed
+587
docs/audits/2026-10-11-completion-gap-analysis.md
new
+71
@@ -0,0 +1,71 @@
1
+# ممیزی فاصله تا تکمیل LifeGuide — ۱۱ اکتبر ۲۰۲۶
2
+
3
+این ممیزی فقط از خواندن فایلهای مخزن تهیه شد. شاخه در زمان خواندن `feat/learning-content-operations` و HEAD برابر `fccc10e9604ae0c6b6b4aa8949b443fb90ca4b1c` بود. `AGENTS.md` و `PROJECT_STATE.md` ابتدا خوانده شدند. **هیچ تست، build، استقرار، بررسی دستگاه یا تغییر زنده در این ممیزی اجرا نشد؛ پذیرش تازه این فهرست UNVERIFIED است.** نتایج قبلی فقط از طریق اسناد شاهد معرفی میشوند، نه بهعنوان اجرای این ممیزی.
4
+
5
+## آنچه باید حفظ شود
6
+
7
+پروژه دیگر APK با API نمایشی نیست. مسیرهای واقعی خانواده/سرپرستی، planner، session مطالعه، صف پایدار، مجوزهای فعلی، ثبتنام قابل بازیابی، پروفایل، دروس، کتابخانه، پیشرفت خصوصی، ارزیابی نسخهدار و بازخورد رضایتمحور وجود دارند. PostgreSQL و Compose مشترک، نقشهای مستقل دیتابیس، assets محلی، آدرس runtime و بسته تحویل هم موجودند. بازسازی این بخشها اتلاف کار و خطر برگشت رگرسیون است.
8
+
9
+شواهد قبلی در [وضعیت پروژه](../../PROJECT_STATE.md)، [ممیزی آموزش](2026-10-11-learning-verification.md) و [تحویل ۰٫۶٫۰](../operations/HANDOVER_0.6.0.md) قرار دارند. سبز بودن آن شواهد بهتنهایی انتشار عمومی، پوشش یک سال آموزشی یا پذیرش واقعی موبایل نیست.
10
+
11
+## فاصلههای مشخص در کد
12
+
13
+| بخش | موجود در کد خواندهشده | فاصله واقعی | بسته محلی قابل اجرا |
14
+|---|---|---|---|
15
+| اتصال اولین APK | Android با API قابل تنظیم، توضیح صریح صفحه، بدون default تأییدنشده | آدرس عمومی سازگار هنوز طبق آخرین سند تأیید نشده؛ ورود آنلاین به سرور نیاز دارد | حفظ setup، آزمون خطای HTML بهجای JSON و گزارش قابلیتهای سرور؛ اتصال عمومی فقط بعد از انتخاب/مجوز مالک |
16
+| محتوای آموزش | `learning_catalog.js`، importer، gates SQL، کتاب/واحد/منبع و پخش درون صفحه | ۱۳۴۸ سرنخ ویدیو، **صفر ویدیوی واقعی با بازبینی کامل و صفر بانک سؤال واقعی منتشرشده**؛ سال چاپ دبیرستان تأییدنشده؛ پوشش واحدها کامل نیست | ابزار تهیه/اعتبارسنجی بسته بازبینی و انتشار/کنارگذاری کنترلشده؛ ابتدا یک درس کامل با شاهد واقعی، سپس گسترش |
17
+| مدیریت محتوا | runtime API فقط SELECT روی تعریف کاتالوگ/سؤال؛ انتشار توسط gate دیتابیس محدود است | importer فقط draft وارد میکند؛ workflow قابل استفاده برای reviewer، revision، withdrawal و گزارش پوشش وجود ندارد | CLI محلی با نقش migrator موجود، dry-run، نسخه/هش و audit؛ از family admin برای platform curator استفاده نشود |
18
+| بازخورد به توسعه | POST/GET/withdraw مالک با consent، rate limit و tombstone؛ جدول status دارد | هیچ route/CLI triage، brief تحقیق، خروجی قابل بازبینی مدیر یا انتقال انتخابی به agent وجود ندارد | گردش محلی صریحِ consented summary → triage → brief؛ بدون خصوصیخوانی، پیام خودکار یا deployment |
19
+| مرور یادگیری | `/me/learning-attempts` و `/me/learning-reviews`؛ سرور پاسخ را تصحیح میکند | client فقط آزمون همان درس/نتیجه جاری را نشان میدهد؛ فهرست مرور موعددار و تاریخچه پذیرفتهشده در UI دیده نشد | صفحه مالک برای مرور/تلاشها، timestamps، انتخاب درس و pending acknowledgement؛ عدم ادعای mastery از یک نمره |
20
+| هدفهای یادگیری | `phase4.js` واقعاً create/read/update/archive مالک دارد | `Phase4Hub` فقط create/list/افزودن check-in را عرضه میکند؛ FutureBuilder خطای goals را نمایش نمیدهد، dialog نوشتن busy/error ندارد؛ edit/archive/history UI غایب است؛ POST mutation-id و PATCH expectedVersion ندارند | تکمیل client روی API موجود، محافظت دوبارکلیک و تاریخچه خصوصی؛ retry نامطمئن/صف آفلاین قبل از قرارداد idempotency/version تبلیغ نشود؛ CRUD سرور را دوباره نسازید |
21
+| خانواده و سرپرستی | API rename/archive/remove member/activate/deactivate guardian با transaction و audit دارد | UI فقط ساخت/دعوت/list/set guardian؛ role/admin transfer فعال و list/revoke invitation API غایباند | UI مدیریت قابلیتهای موجود؛ بسته جدا برای lifecycle نقش/admin با invariant آخرین مدیر و لغو دسترسی فوری |
22
+| حساب | ثبتنام ایمیل اختیاری/phone، verification/OTP/recovery/password/session موجود | route برای افزودن/تعویض تماس تأییدشده یا بستن حساب وجود ندارد؛ profile PATCH تماسها را تغییر نمیدهد | طراحی/تست مستقل contact proof و closure غیرمخرب با لغو session، تعیین تکلیف آخرین مدیر و سیاست retention؛ حذف واقعی داده/اجرای زنده جداگانه |
23
+| سال/نیمسال/زمینه زندگی | `life-contexts` list/create؛ سال و term create؛ `academic_year.active` و `life_context.active` | read یک مورد، edit و archive lifecycle سال/term/context وجود ندارند؛ term archived flag ندارد | owner-only lifecycle، نگهداری linked task/history، date containment و جلوگیری از نوشتن روی ancestor آرشیوی |
24
+| صفحه مدرسه | overview، create assignment/exam؛ subject/class owner CRUD سرور موجود | UI subjectها فقط read-only، کلاس/تاریخ/teacher edit/archive ندارد؛ quickSetup فقط ریاضی و تاریخ Gregorian سپتامبر–ژوئن میسازد | school editor بهجای setup ثابت؛ dates صریح، نمایش فارسی، استفاده از پروفایل/سال انتخابی؛ retry نباید سال/term تکراری بسازد |
25
+| امتحان/نمره | assignment/exam با gradePoints/gradeOutOf و validation/version؛ report item نمره را نشان میدهد | SchoolPage فقط تعداد grades را نشان میدهد؛ grade history، subject/exam breakdown و rubric وجود ندارد | گزارش دقیق مبتنی بر داده ثبتشده و مالکیت؛ نمره مدرسه از quiz تمرینی و تأیید سرپرست جدا بماند |
26
+| گزارش والد | گزارش مجوزدار واقعی، trend، task/status/time و grade در item؛ ۷/۳۰ روز در UI | query taskهای همه زمانها را میخواند؛ `totalTasks/completedTasks/subjects` همهزمانهاند، درحالیکه زمان ثبتشده محدود به بازه است؛ UI معنای دو بازه را توضیح نمیدهد | تصمیم روشن «کل کارها» در برابر «این بازه»، metricهای مجزای بازه/همهزمانه و تست boundary تهران؛ aggregation بر شناسه subject بهتر از نام مشترک |
27
+| PWA آفلاین سرد | worker فقط public `assets/canvaskit/icons` را network-first cache میکند؛ API/config/auth/nav cache نمیشود | `index.html`، `main.dart.js` و bootstrap تضمین offline startup ندارند؛ `restoreSession` refresh آنلاین میخواهد | طراحی offline shell عمومی نسخهدار + صفحه قفل/وضعیت قابل اعتماد؛ token/مجوز از cache جعلی ساخته نشود، config شبکه معتبر حفظ شود |
28
+| timer و sync | pause/resume/stop، interval و ACK، conflict، restart و durable queue موجود | event بعدی تا تأیید event قبلی محدود است؛ تجربه چند event آفلاین و cold restart با دستگاه واقعی باز است؛ UI correction/archive جلسه در `study_ui.dart` عرضه نمیکند | UX محدودیت صریح و صفحه تاریخچه/correction روی API موجود؛ گسترش چند event فقط با مدل causal/version و تست مستقل |
29
+| accessibility | RTL و semantics اولیه وجود دارد؛ سند مرورگر dynamic progress semantics را حلنشده میداند | screen reader/physical touch/keyboard و همه breakpointها تأیید نشدهاند | focused semantics regression، keyboard/touch target checks و سپس Android/Safari واقعی؛ screenshot تأیید screen reader نیست |
30
+| انتشار | `ir.lifeguide.app`، Gradle جلوی debug release key را میگیرد؛ workflow دستی disabled | key مالک و actual release signing، APK upgrade روی دستگاه، public reachability و rollout تأیید نشده | نگهداشتن artifact تست؛ owner key در secrets و پذیرش واقعی بعد از آمادهشدن، بدون انتشار خودکار |
31
+
32
+فایلهای مبنا: [server.js](../../backend/src/server.js)، [profile_router.js](../../backend/src/profile_router.js)، [auth_router.js](../../backend/src/auth_router.js)، [phase3.js](../../backend/src/phase3.js)، [phase4.js](../../backend/src/phase4.js)، [school_crud_router.js](../../backend/src/school_crud_router.js)، [study_sessions.js](../../backend/src/study_sessions.js)، [learning_assessment.js](../../backend/src/learning_assessment.js)، [main.dart](../../apps/lifemate/lib/main.dart)، [phase3_ui.dart](../../apps/lifemate/lib/phase3_ui.dart)، [phase4_ui.dart](../../apps/lifemate/lib/phase4_ui.dart)، [learning_quiz_ui.dart](../../apps/lifemate/lib/learning_quiz_ui.dart)، [dashboard_ui.dart](../../apps/lifemate/lib/dashboard_ui.dart)، [worker](../../apps/lifemate/web/lifeguide-sw.js)، [runtime_controller.dart](../../apps/lifemate/lib/runtime_controller.dart).
33
+
34
+## اولویت و مالکیت بستههای اجرایی
35
+
36
+این جدول تقسیم کار پیشنهادی است؛ تخصیص نهایی و integration با lead engineer است. هر بسته یک مالک اصلی دارد. `api.dart`، `main.dart`، `server.js` و شماره migration نقاط مشترکاند و فقط با هماهنگی lead تغییر کنند.
37
+
38
+| اولویت/بسته | مالک اصلی/فایلهای پیشنهادی | معیار پذیرش مستقل |
39
+|---|---|---|
40
+| P0: عملیات بازبینی و انتشار | Backend/content operations؛ فایلهای جدید `backend/scripts/*learning*review*.js` و runbook محتوا | dry-run بدون mutation؛ draft پیشفرض؛ record ناقص/قدیمی/بدون rights رد شود؛ complete review با role جدا و synthetic fixture پذیرفته؛ runtime/parent نتواند منتشر کند؛ withdrawn منبع دیگر به learner عرضه نشود؛ history محفوظ |
41
+| P0: یک مسیر آموزشی کامل | Product/research + reviewer مشخص؛ بسته evidence/سؤال محلی جدید، code ندارد مگر gate لازم | چاپ رسمی و صفحات/هدف روشن؛ رسانه کامل واقعاً مشاهده و timestamp-reviewed؛ تطبیق هدف، صحت، سن، حقوق نمایش؛ سؤال اصیل با توضیح و remediation بازبینی؛ lesson → quiz → spaced review → reopen، مستقل API/DB؛ هر بخش unrun، UNVERIFIED |
42
+| P1: صفحه مرور و تلاشها | Client education؛ فایل جدید `learning_reviews_ui.dart` و تست مربوط؛ wiring با root | only-own، empty/error/offline واضح؛ بازه زمانی و server timestamp؛ history پس از reopen از API؛ pending پاسخ duplicate نسازد؛ expiry مجوز را حذف کند و work unsent را نگه دارد؛ بدون نسبتدادن اثبات فهم |
43
+| P1: triage توسعه رضایتمحور | Backend operations؛ CLI/validator/brief template جدید؛ shared learning_feedback route فقط root | بدون رضایت/پس از withdrawal هیچ متن export نشود؛ خلاصه انتخابی و بدون contact/chat/health؛ export بعدی withdrawal را منعکس کند؛ وضعیت/نسخه و auditor ثبت؛ no send/no autonomous deploy؛ نسخه قبلاً صادرشده قابلیت magic revoke ندارد و runbook آن را بگوید |
44
+| P1: تجربه goals/check-in | Client learning؛ ترجیحاً `learning_goals_ui.dart` جدید، adapter مشترک با root | create → reopen → read → edit → archive؛ API مستقل همان record؛ owner فقط؛ error دیده شود؛ double tap یک intent؛ notes check-in خصوصی؛ archive با تاریخچه linked check-in باقی بماند |
45
+| P1: UI مدیریت خانواده | Client family؛ فایل جدید `family_management_ui.dart`، wiring با root | rename/archive/removal/revoke guardian روی API موجود؛ warning و server acknowledgement؛ revoked والد فوراً 403 و UI داده قبلی را پاک کند؛ آخرین مدیر 409، نه orphan family؛ lost response به موفقیت ساختگی تبدیل نشود |
46
+| P2: lifecycle نقش/دعوت | Backend identity؛ router مستقل جدید + تست migration تنها بعد از تصمیم شماره توسط root | admin transfer atomic؛ آخرین active admin محفوظ؛ cross-family/teen/nonadmin رد؛ تغییر role رابطه guardian ناسازگار و outstanding invite را معتبر نگه ندارد؛ invitation revoke + expiry + accept race امن؛ اسناد audit |
47
+| P2: lifecycle مدرسه | Backend school؛ router جدا یا `school_crud_router.js` و tests، شماره migration با root | owner read/update/archive context/year/term؛ nested dates معتبر؛ ancestor archive جلو create/edit جدید را بگیرد؛ homework/history/grade حفظ؛ outsider/guardian هیچ mutation؛ two-device stale write conflict |
48
+| P2: editor مدرسه و گزارش دقیق | Client school و backend reporting با مالک واحد/کار sequential | انتخاب سال/term، ساخت/edit/archive درس/کلاس؛ setup retry duplicate نسازد؛ صفر/مفقود grade با شکست فرق داشته باشد؛ weekly/monthly metric با taskهای بیرون بازه و timezone boundary آزمایش؛ داده خصوصی وارد aggregate نشود |
49
+| P2: offline cold shell | Cross-platform/security؛ worker/bootstrap/runtime config تحت یک مالک | actual compiled browser: warm install → close → offline reopen؛ فقط shell عمومی و وضعیت محفوظ، نه ورود جعلی؛ cache نسل قدیم بهروزرسانی امن؛ config/HTTP auth از cache worker سرو نشوند؛ unsent bytes محفوظ؛ Safari همچنان پذیرش سختافزاری جدا |
50
+| P3: contact/closure | Backend identity/safety؛ طراحی/ADR سپس router + tests | verified proof جدید لازم؛ old channel تا تأیید جدید سالم؛ concurrent swap/OTP expiry/replay امن؛ closure لغو فوری session/guardian/grant؛ no orphan admin؛ retention/export/restore semantics پیش از حذف واقعی مشخص |
51
+
52
+## محدودیتهایی که با کدنویسی محلی حل کامل نمیشوند
53
+
54
+| نوع مانع | شرط لازم | کار مجاز در این محیط |
55
+|---|---|---|
56
+| مالک/سرور زنده | انتخاب میزبان قابل دسترس ایران، مجوز مشخص deploy/DNS/migration/merge/release | package، smoke، تست fixture، runbook، PR و شواهد؛ هیچ اقدام زنده |
57
+| دستگاه/شبکه ایران | Android واقعی، iPhone/iPad Safari و A2HS، owner LAN/Windows، VPN-free کاربران ایران | Chromium/HTTP/SQL substitutes با محدودیت نامبرده؛ هرگز معادل Safari/ایران اعلام نشود |
58
+| امضا/تحویل واقعی | key/certificate مالک در secret manager، upgrade و دادههای pending روی دستگاه | workflow gated و debug artifact؛ بدون key انتشار ادعا نشود و برای signer mismatch حذف data توصیه نشود |
59
+| محتوای تدریس | دسترسی به آخرین چاپ رسمی، مشاهده کامل واقعی، حقوق embed و reviewer صلاحیتدار | ابزار، evidence checklist، shortlist و نمونه محدود واقعاً قابل بررسی؛ metadata را full review نامگذاری نکنید |
60
+| AI/سلامت/حمایت کودک | رضایت سنمتناسب، privacy/retention، محل نگهداری داخل کشور، safeguarding و بررسی متخصص | آموزش عمومی غیرتشخیصی، ADR/ports غیرفعال؛ no psychologist impersonation، no private-chat mining، no auto-parent-forwarding |
61
+| پیامک/ایمیل/push | انتخاب provider و هزینه/eligibility/تحویل واقعی | adapter pluggable، unit/integration synthetic و error behavior؛ no signup/pay/message به فرد دیگر |
62
+
63
+«تا انتها ادامه بده» مجوز توسعه لازم و برگشتپذیر است؛ جای مجوز صریح اقدامات زنده، خرید، انتشار، داده واقعی یا تغییر حساس دسترسی را نمیگیرد. هر بسته محلی باید کد/ابزار، آزمون مناسب و شاهد، مستندات و PR داشته باشد. تکمیل همه مقاطع، مشاوره خانواده یا نسخه operational تنها وقتی قابل گزارش است که شرایط واقعی همان قابلیت برقرار و آزمایش شده باشد.
64
+
65
+## نکات تصمیم محصول
66
+
67
+- School quiz در کد فعلی فقط multiple-choice با تصحیح server و توضیح است. chapter exam، پاسخ تشریحی با rubric، baseline تشخیصی، misconception/objective coverage و effectiveness pilot هنوز پیادهسازی کامل نیستند. در انتخاب روش از retrieval/spacing/feedback استفاده شود؛ برنامه ثابت ۱/۳ روز فعلی policy آزمایشی است، نه استاندارد واحد همه سنها.
68
+- خانواده یک workspace مجوزدار است؛ نقش والد/مدیر خانواده هرگز مجوز curator سراسری، private quiz history، گفتگو، سلامت یا data export نیست. اشتراک آموزشی جدید، مجوز و مدل داده صریح میخواهد.
69
+- گزارش فعلی recorded duration را خوداظهاری مینامد؛ این مرز باید در reportهای جدید هم بماند. نمره مدرسه، پاسخ آزمون، confidence و تأیید شاهد نباید در یک «اثبات مطالعه» ادغام شوند.
70
+- حلقه بازخورد محصول با support/safeguarding متفاوت است. disclosure کودک بهصورت خودکار به brief مدیر، AI خارجی یا والد منتقل نشود؛ آن نیاز workflow بررسیشده جدا است.
71
+- اول ابزار عملیات و یک بسته محتوای واقعاً تأییدشده؛ سپس گسترش. انتشار ۱۳۴۸ draft یا پرکردن بانک سؤال بدون بررسی، completion محسوب نمیشود.
docs/decisions/0014-consented-content-operations.md
new
+13
@@ -0,0 +1,13 @@
1
+# ADR0014 — Separate content operations from family permissions
2
+
3
+Date: 2026-10-11. Status: Accepted for authorized local implementation; live grants/publication remain gated.
4
+
5
+Existing learner feedback is voluntary chosen text, with withdrawal. To turn it into reviewable development work, add independent expiring/revocable content capabilities. A family parent/admin never gains cross-user content access by implication. Runtime credentials cannot grant capabilities or publish catalogue definitions.
6
+
7
+Review statuses use the existing received/triaged/planned/declined vocabulary. Versioned transitions and actor-scoped UUID acknowledgements make retries safe. `released` cannot be set by this API; a later publication workflow must supply real evidence and separate approval.
8
+
9
+Development briefs contain public catalogue metadata, category counts and fixed tasks only. User/reviewer free text, source feedback identifiers and private contacts/chats/notes/health are excluded. Every retrieval checks source consent/version/status and current capabilities. Withdrawal invalidates the brief; previously copied material cannot be remotely erased, so copies must remain minimal and be revalidated before action.
10
+
11
+The operator client uses a memory-only online inbox and explicit retry for durable ID/version/status mutation intents. Errors and revocation clear rows instead of presenting stale summaries as current. External AI, automatic messaging, publishing and deployments remain disabled. This provides an auditable human-controlled research loop, not autonomous changes to the product.
12
+
13
+See [design](../superpowers/specs/2026-10-11-content-operations-design.md) and [plan](../superpowers/plans/2026-10-11-content-operations.md). Actual verification receipts will be added after execution.
docs/operations/CONTENT_REVIEW.md
new
+132
@@ -0,0 +1,132 @@
1
+# بررسی و آمادهسازی محتوای LifeGuide
2
+
3
+این بسته ابزار محلی بازبینی را به دروازههای موجود دیتابیس در مهاجرتهای
4
+0013 و0015 متصل میکند. ابزار، مشاهدهٔ فیلم یا تأیید مدرس متخصص را انجام
5
+نمیدهد. منابع واقعی و پیشنویس ریاضی اول همچنان DRAFT هستند؛
6
+`reviewRecord:null` نباید با تأیید ساختگی جایگزین شود.
7
+
8
+**در این نسخه، نوشتن فقط روی محتوای آزمایشی ساختگی مجاز است.** هیچ فرمان
9
+این راهنما برای سرور زنده، انتشار عمومی، دادهٔ واقعی خانواده یا تغییر
10
+مجوزهای زنده تأیید نشده است. ابزار هیچ فیلمی دانلود نمیکند و به سرویس
11
+هوش مصنوعی، پیامک، ایمیل یا آپارات درخواست شبکه نمیفرستد.
12
+
13
+## پیشنیاز و اتصال
14
+
15
+Node22، PostgreSQL و مهاجرت0020 لازماند. اتصال را از فایل خصوصی خارج
16
+مخزن یا secret manager بارگذاری کنید. رمز و URL حاوی رمز را در تاریخچهٔ
17
+ترمینال، چت، فایل JSON عملیات یا مخزن قرار ندهید.
18
+
19
+متغیرهای لازم:
20
+
21
+- `CONTENT_REVIEW_DATABASE_URL`: اتصال جداگانهٔ اپراتور/مهاجر به دیتابیس
22
+ آزمایشی روی `localhost`، `127.0.0.1` یا `::1`.
23
+- `CONTENT_REVIEW_SYNTHETIC_ONLY=true`: فعالسازی صریح عملیات آزمایشی.
24
+
25
+ابزار از `DATABASE_URL` برنامه بهعنوان جایگزین استفاده نمیکند. پارامتر
26
+query و fragment اتصال پذیرفته نمیشوند؛ این پارامترها میتوانند تنظیمات
27
+درایور را تغییر دهند. نام دیتابیس باید `lifeguide_*test` با پسوند مجاز،
28
+`lifemate_ci` یا نام دقیق آزمون تفکیک نقشهای پروژه باشد. کاربر
29
+`lifeguide_api` و `lifeguide_backup` مجاز به اجرای ابزار نیستند. اپراتور
30
+نوشتن باید UPDATE منابع و INSERT/UPDATE تعریف آزمون و INSERT دفتر عملیات
31
+را داشته باشد؛ نقش API فقط خواندن تعریفهای آموزشی را دارد.
32
+
33
+## مشاهده و بررسی بدون تغییر
34
+
35
+از پوشهٔ `backend`، پس از بارگذاری خصوصی متغیرها:
36
+
37
+```bash
38
+node scripts/review-learning-content.js inspect video VIDEO_UUID
39
+node scripts/review-learning-content.js inspect assessment ASSESSMENT_UUID
40
+node scripts/review-learning-content.js dry-run /private/path/operation.json
41
+```
42
+
43
+شناسهها را با UUID موجود در دیتابیس آزمایشی جایگزین کنید. `inspect` وضعیت
44
+فعلی، هش ثبتشده، هش محاسبهشده، هش زمینه و صلاحیت فعلی نمایش را در یک
45
+snapshot فقطخواندنی برمیگرداند. هش ویدیو اثرانگشت **فرادادهٔ ثبتشده**
46
+است؛ ثابتماندن فایل ویدیو در میزبان، مشاهدهٔ کامل یا حق نمایش را اثبات
47
+نمیکند.
48
+
49
+`dry-run` همان اعتبارسنجی وضعیت، نسخه، هش، چاپ کتاب و گواهی بازبینی را در
50
+تراکنش فقطخواندنی اجرا میکند. خروجی `mode:dry-run` هیچ تغییر یا رسید
51
+پایدار ایجاد نمیکند. وضعیت `proposedStatus` صرفاً نتیجهٔ بررسی پیشنهادی
52
+است. ورودی فایل باید JSON معمولی و حداکثر1MiB باشد؛ فیلدهای ناشناخته و
53
+فیلدهای اطلاعات خصوصی رد میشوند.
54
+
55
+## قرارداد فایل عملیات
56
+
57
+هر عملیات شامل `schemaVersion:1`، یک `mutationId` ثابت، `entityType`
58
+(`video` یا `assessment`)، `entityId`، `operation` و مقادیر مشاهدهشدهٔ
59
+`expectedStatus`، `expectedContentHash` و `expectedContextHash` است.
60
+عملیات آزمون علاوه بر اینها `expectedVersion` دارد. UUID عملیات را پس
61
+از پاسخ نامشخص تغییر ندهید؛ تکرار همان فایل، رسید قبلی و وضعیت **فعلی**
62
+محتوا را برمیگرداند. تغییر فایل با همان UUID با `mutation_id_reused` رد
63
+میشود. نسخه/هش/وضعیت قدیمی نیز بدون تغییر داده رد میشود.
64
+
65
+برای ساخت یا اصلاح آزمون، `operation:draft_assessment` و `unitId` و
66
+`questions` لازماند. تعریف جدید `expectedStatus:absent`،
67
+`expectedVersion:0` و `expectedContentHash:null` دارد. هش زمینهٔ تعریف
68
+جدید را اپراتور از فرادادهٔ فعلی درس با تابع صادرشدهٔ
69
+`assessmentContextHash` در `src/learning_assessment.js` محاسبه میکند:
70
+`book_code`، `school_year`، `book_evidence_url`، `unit_key`،
71
+`unit_title_fa` و `unit_evidence_url`. `inspect assessment` فقط برای تعریف
72
+موجود کار میکند؛ رابط ساخت فایل اولیه از درس در این بسته پیاده نشده
73
+است. `dry-run` هر اختلاف با زمینهٔ واقعی دیتابیس را رد میکند.
74
+
75
+هر سؤال شامل `id`، `objectiveId`، `promptFa`، `choices`،
76
+`correctChoiceId`، `explanationFa` و `remediationFa` است؛ هر گزینه فقط
77
+`id` و `textFa` دارد. حداکثر20 سؤال و2 تا6 گزینه برای هر سؤال مجاز است.
78
+ساخت پیشنویس، تأیید آموزشی محسوب نمیشود. تغییر پیشنویس یا تعریف
79
+پسگرفتهشده نسخه را یک واحد زیاد و بازبینی را خالی میکند. تعریف منتشرشده
80
+قابل ویرایش نیست؛ ابتدا باید با عملیات مستقل پس گرفته شود. snapshot
81
+سؤالهای تلاشهای قبلی دانشآموز حفظ میشود.
82
+
83
+برای `operation:publish`، گواهی `review` باید با کتاب/سال/درس و هش جاری
84
+منطبق و تاریخ آن معتبر و گذشته باشد. گواهی ویدیو شامل این تأییدهای صریح و
85
+شرح مستند هرکدام است: مشاهدهٔ تمام فیلم، انطباق چاپ، صحت، تناسب سنی، حق
86
+embed و پوشش پرسشها. گواهی آزمون شامل صحت، تناسب، انطباق چاپ، پوشش هدف،
87
+هش محتوا/زمینه و یادداشت بازبینی است. چاپ نامشخص، درس غیرفعال، دسترسی
88
+غیررایگان فیلم، گواهی ناقص یا هش ناهماهنگ قابل انتشار نیست.
89
+
90
+## اعمال آزمایشی و پسگرفتن
91
+
92
+```bash
93
+node scripts/review-learning-content.js apply /private/path/operation.json
94
+```
95
+
96
+علاوه بر اتصال محلی آزمایشی، کلید کتاب باید با
97
+`synthetic-publication:` شروع شود. گواهی انتشار نیز باید
98
+`evidenceScope:SYNTHETIC_TEST_ONLY` و نام بازبین با پیشوند `SYNTHETIC`
99
+داشته باشد. این شرط مانع تبدیل منابع واقعی تحقیق به محتوای ظاهراً
100
+تأییدشده میشود. پرچم true در یک fixture اثبات بازبینی انسانی نیست.
101
+
102
+برای پسگرفتن، فایل تازه با UUID تازه، `operation:withdraw` و وضعیت/هش
103
+جاری بسازید؛ `review` در این عملیات وجود ندارد. رسید انتشار قدیمی پس از
104
+پسگرفتن، محتوا را دوباره منتشر نمیکند. همزمانی واردکننده/اپراتور با قفل
105
+مشترک کاتالوگ و قفل ردیفها کنترل میشود؛ اصلاح زمینه هنگام انتظار، گواهی
106
+قدیمی را نامعتبر میکند.
107
+
108
+جدول `content_publication_audit` فقط شناسه، هش، وضعیت، نسخه، نقش اپراتور
109
+و زمان پذیرش را ذخیره میکند. متن بازخورد، نام خانواده، چت، یادداشت، سلامت،
110
+پاسخ دانشآموز یا نثر گواهی بازبین به این دفتر منتقل نمیشود. مسیر HTTP
111
+برای انتشار یا اعطای مجوز اضافه نشده است.
112
+
113
+## شواهد این بسته و محدودیتها
114
+
115
+در2026-10-12، Node22.23.3 روی دیتابیس تازهٔ محلی PostgreSQL16 با
116
+مهاجرتهای پایدار0001–0015 و0020 اجرا شد: **12/12 آزمون موفق، صفر خطا،
117
+لغو یا skip**. فرمانهای واقعی CLI برای مشاهده، dry-run، اعمال، تکرار و
118
+پسگرفتن اجرا شدند. دو درخواست همزمان یک رسید ایجاد کردند؛ انتظار واقعی
119
+قفل با `pg_blocking_pids` مشاهده و اصلاح همزمان زمینه بدون انتشار رد شد.
120
+دو نقش NOLOGIN با نام تصادفی و SELECT-only فقط در fixture مستقل آزموده
121
+و پاک شدند؛ نقشهای مشترک یا اعتبارنامههای آنها تغییر نکردند.
122
+
123
+این اجرا، مهاجرت یکپارچهٔ20مرحلهای، نقشهای واقعی runtime در Compose،
124
+کل آزمونهای پروژه، build، دستگاه یا سرور زنده را تأیید نمیکند؛ این موارد
125
+در این بررسی متمرکز **UNVERIFIED** هستند و هماهنگکننده جداگانه اجرا
126
+میکند. مشاهدهٔ تمام فیلمها، اجازهٔ واقعی ارائهدهنده، بازبینی متخصص،
127
+همترازی کامل کتاب جاری و انتشار محتوای واقعی نیز **UNVERIFIED** هستند.
128
+
129
+قبل از انتشار واقعی باید مالک برای محیط و اقدام زنده مجوز بدهد، بازبینی
130
+متخصص و مستند حقوق استفاده کامل شود و مسیر اپراتور واقعی با آزمون مستقل
131
+و rollback طراحی شود. محدودیت synthetic-only این نسخه را برای آن کار
132
+دور نزنید.
docs/research/2026-10-11-math-pilot-review.md
new
+99
@@ -0,0 +1,99 @@
1
+# پایلوت ریاضی اول لایفگاید — منبع، طراحی و دروازه بازبینی
2
+
3
+تاریخ اجرای پژوهش:۲۰۲۶-۱۰-۱۱. این فایل و `backend/content/drafts/grade1-math-pilot.json` **پیشنویس** هستند. هیچ محتوایی منتشر نشد؛ هیچ بررسی معلم متخصص، تماشای کامل ویدیو یا نتیجه یادگیری کودک ادعا نمیشود. این پایلوت تم نخست یک کتاب است، نه تکمیل آموزش یک سال یا پایههای۱–۱۲.
4
+
5
+## منبعی که واقعاً بررسی شد
6
+
7
+[رکورد رسمی ریاضی اول](http://www.chap.sch.ir/books/14145) با HTTP200 دریافت شد. فیلدهای رسمی، کد۱۰۵ و سال۱۴۰۵–۱۴۰۶ را دارند؛ پیوند PDF از همان HTML استخراج شد. [PDF رسمی](http://www.chap.sch.ir/sites/default/files/lbooks/1405-1406/8/C105.pdf) واقعاً دریافت شد:۳۸٬۲۱۵٬۷۸۹بایت،۱۸۴صفحه، SHA256 `8c2323ce542adcb4e53d79287cccb16a050a2a63ef2484ac337addf076b118d4`. متن صفحه۲ PDF عبارت چاپ شانزدهم۱۴۰۵ را دارد. PDF فقط برای بازبینی پژوهشی محلی دریافت شد؛ فیلمی دانلود یا باز میزبانی نشد. نسخه PDF/تصاویر کتاب به مخزن افزوده نشدهاند.
8
+
9
+صفحات چاپی۱–۷، معادل صفحات PDF۷–۱۳، با `pdftotext -layout` استخراج و **تمام هفت صفحه به PNG تبدیل و واقعاً مشاهده شدند**. متن استخراجشده بهتنهایی برای ترتیب راستبهچپ اعداد/شکلها قابل اعتماد نیست؛ نمونهها با تصویر کنترل شدند. نتیجه محدود به همین صفحات است:
10
+
11
+| صفحه چاپی / PDF | مشاهده مستقیم | کاربرد در طراحی اصلی پایلوت |
12
+|---|---|---|
13
+|۱ /۷|لوحه محیط روزمره با اشیا/شکلها و زمینه بخش|گفتوگوی کوتاه درباره اشیای آشنا؛ صورتسؤال یا تصویر کتاب بازنشر نمیشود.|
14
+|۲ /۸|تفکیک و شمردن شکلهای مثل هم؛ توصیه دستورزی پیش از صفحه|دستهبندی، یک اشاره/یک واژه برای هر عضو، تعداد تا پنج.|
15
+|۳ /۹|تطبیق تعداد هر نوع شکل با خانههای علامتدار|نمایش یکبهیک شیء و خانه؛ خانه خالی در شمار خانههای پر وارد نمیشود.|
16
+|۴ /۱۰|بازنمایی الگوی تکراری با خانهها؛ درخواست توضیح رابطه|پیداکردن بخش تکراری و توضیح آن، با شکل و نام علاوه بر رنگ.|
17
+|۵ /۱۱|تشخیص دسته الگودار و ادامه همان ترتیب|تشخیص قاعده در برابر ردیف نامنظم؛ ادامه AB و AAB.|
18
+|۶ /۱۲|اتصال دستههای همتعداد؛ توصیه استفاده از اشیا|جفتکردن، بررسی کارت اضافه و جداسازی تعداد از بزرگی/فاصله.|
19
+|۷ /۱۳|نمایش مقدار با انگشتان مختلف؛ ادامه الگو|دو بازنمایی از یک مقدار؛ جایگزین کارت برای محدودیت حرکتی.|
20
+
21
+کتاب **[۱۰۵۱، ریاضی دوستداشتنی اجرای آزمایشی](http://www.chap.sch.ir/books/15023)**،۱۴۰۵–۱۴۰۶، رکورد جداگانه دارد و جایگزین۱۰۵ فرض نشده است. فهرست کدهای۱۰۵ و۱۰۵۱ در کاتالوگ فعلی پروژه هر دو `units=[]` بود؛ بنابراین این پایلوت شکاف واقعی ریاضی اول را نشان میدهد. افزودن داده به کاتالوگ عمومی، نیازمند importer مستقل و بازبینی مرزهای نسخه است؛ این پژوهش کاتالوگ بزرگ را تغییر نداد.
22
+
23
+نسخه رسمی کتاب محدودیت حقوق نشر اجزا/تصویر/اقتباس دارد. مثالها، پرسشها و توضیحهای پایلوت **اصلی** هستند و از تمرین/تصویر کتاب کپی نشدهاند؛ ارجاع به صفحه مجوز بازنشر کتاب یا تأیید حقوقی نیست. توصیف «شمارش نهایی/حفظ تعداد با تغییر فاصله» گسترش آموزشی اصلی مبتنی بر شمارش و مقایسه است، نه نقلقولِ هدف رسمی چاپشده.
24
+
25
+## روش یادگیری و حدود شواهد
26
+
27
+چهار جستوجوی Exa با۵،۱۰،۵،۵ نتیجه درخواست شد: `sources_reviewed=25` شمار نتایج درخواستی است، نه۲۵ویدیوی دیدهشده یا۲۵منبع مستقل معتبر. صفحات رسمی کتاب و منابع منتخب با fetch و HTTP مستقل خوانده شدند. سه منبع آموزشی اصلی زیر واقعاً با fetch خوانده شدند:
28
+
29
+- [EEF، ریاضی سالهای اولیه و KS1،۲۰۲۰](https://educationendowmentfoundation.org.uk/education-evidence/guidance-reports/early-maths): شناخت پیشدانسته کودک، فعالیت کوتاه هدفمند و پیوند ریاضی با کار روزمره. سن هدف۳–۷سال در گزارش آمده؛ پایه بهتنهایی جای تعیین سن/نیاز واقعی نیست.
30
+- [EEF، ابزار ملموس و بازنمایی](https://educationendowmentfoundation.org.uk/early-years/maths/use-manipulatives-and-representations-to-develop-understanding): پیوند **صریح** کارت/انگشت و مفهوم، چند بازنمایی و توضیح راهبرد؛ ابزار جذاب ممکن است حواس را پرت کند. انتخاب ابزار باید دلیل آموزشی داشته باشد.
31
+- [IES/WWC،۲۰۰۷](https://ies.ed.gov/ncee/WWC/PracticeGuide/1): تناوب مثال حلشده و حل مستقل، بازیابی فعال، مرور فاصلهدار، توضیح چرایی، پیوند عینی و انتزاعی. گزارش برای پایههایK–۱۲ و بالاتر است؛ زمانبندی دقیق این پایلوت از منبع استخراج نشده است.
32
+
33
+پایلوت شش بخش دارد: دستهبندی/شمارش → شیء/خانه → تشخیص/توضیح الگو → همتعداد بودن → دو نمایش از یک مقدار → بازیابی/انتقال. هر بخش شامل هدف، مثال حلشده اصلی، تمرین هدایتشده، تمرین مستقل و نشانه مشاهدهپذیر است. دسترسی از میانه سال و برگشت آزاد به بخشها حفظ میشود؛ کودک با یک نتیجه پایین در مسیر قفل نمیشود.
34
+
35
+بانک اولیه۱۰پرسش انتخابی،۳پرسش تازه بازیابی و۳موقعیت انتقال با rubric دارد. سؤالهای انتخابی با توضیح و تمرین اصلاحی همراهاند؛ کلید پاسخ باید تا ارسال در سرور بماند. پرسش انتقال نیازمند مشاهده/قضاوت محدود و نسبتدادهشده به ناظر است؛ فعلاً API آزمون خودکارِ تشریحی یا تأیید واقعی آن پیاده نشده است. `independently_observed` در rubric پیشنویس، ورودی برای طراحی آینده است؛ مدرک قطعی یا status عمومی `verified` نیست.
36
+
37
+خواندن روان و نوشتن رقم پیشنیاز نیست. بزرگسال مطمئن ممکن است متن را بخواند؛ کمک او باید از پاسخ مستقل تفکیک شود. نمایش فقط متن روی دستگاه برای همه کلاساولیها کافی نیست. خواندن صوتی محلی/دارای مجوز، رابط تصویری و دسترسپذیری هنوز **UNVERIFIED** هستند؛ صدای AI خارجی فعال نمیشود. حرکت انگشت شرط قبولی نیست و کارت جایگزین دارد. از کارتهای بزرگ/بیخطر و وسایل ایمن استفاده میشود، نه اشیای کوچک یا تیز.
38
+
39
+مرور۱،۷،۲۱روز و بخشهای۵–۱۰دقیقهای **پیشنهاد اولیه محصول** هستند، نه برنامه علمی بهینه اثباتشده برای همه. با سیاست فعلی سرور `pilot-1-or-3-days` یکسان نیستند؛ تغییر سیاست سرور بدون طراحی/آزمون در این پژوهش انجام نشده است. فاصله و سطح کمک باید پس از مشاهده پایلوت تنظیم شوند. پاسخ درست، سرعت، اعتماد، تایمر و تماشای ویدیو مساوی تسلط یا تضمین فهم نیستند.
40
+
41
+## چهار نامزد فیلم؛ هیچکدام تأیید کامل ندارند
42
+
43
+[نمایه نردبون](https://nardeboun.ir/grade/1/riazi/ch1) واقعاً HTTP200 دریافت و شناسهها از داده صفحه استخراج شدند. برای هر چهار شناسه، API فراداده آپارات واقعاً HTTP200 داد. کانال `MMikaniki` عنوان صفحات متناظر دارد؛ جمع مدت فراداده۳۳دقیقه۱۴ثانیه است. مقایسه عنوان، صفحه و مدت فقط سرنخ نگاشت است.
44
+
45
+| شناسه / نشانی | ادعای صفحات | مدت | تاریخ انتشار فراداده | وضعیت |
46
+|---|---|---|---|---|
47
+|[Ux4Du](https://www.aparat.com/v/Ux4Du)|۱–۲|۱۱:۳۳|۲۲شهریور۱۳۹۹|DRAFT؛ metadata free، نه تماشای کامل.|
48
+|[l9713d3](https://www.aparat.com/v/l9713d3)|۳|۵:۰۱|۲۳شهریور۱۳۹۹|DRAFT؛ انطباق چاپ۱۴۰۵ UNVERIFIED.|
49
+|[y93e145](https://www.aparat.com/v/y93e145)|۴–۵|۹:۱۱|۲۴شهریور۱۳۹۹|DRAFT؛ دقت حل/تناسب سن UNVERIFIED.|
50
+|[x95j64m](https://www.aparat.com/v/x95j64m)|۶–۷|۷:۲۹|۲۵شهریور۱۳۹۹|DRAFT؛ حق نمایش نهایی UNVERIFIED.|
51
+
52
+نشانی فراداده هر فیلم: `https://www.aparat.com/etc/api/video/videohash/<hash>`. `cost_type.type=free` و `frame` رسمی مشاهده شد. GET قاب اول `https://www.aparat.com/video/video/embed/videohash/Ux4Du/vt/frame` واقعاً HTTP200/text-html،۵۰۳بایت و `X-Frame-Options: ALLOWALL` داد؛ این تنها دریافت پوسته قاب است، نه اجرای کامل پخش. fetch متن عمومی بعضی صفحات آپارات فقط پوسته یا خطای محتوای خالی برگرداند؛ متن آموزش از آن به دست نیامد.
53
+
54
+فراداده این چهار مورد هیچ transcript/subtitle field قابل استفاده برای بررسی کامل ارائه نکرد. از این نمیتوان نتیجه گرفت زیرنویس وجود ندارد؛ وجود/کیفیت آن **UNVERIFIED** است. هیچ فایل ویدیویی، audio، caption استخراجشده از رسانه یا snapshot تصویر آموزشی ویدیو دریافت نشد؛ فیلمها کامل تماشا نشدند. فراداده raw شامل fieldهای غیرضروری است و فقط فیلدهای عمومی حداقلی در draft نگهداری شده است.
55
+
56
+توضیح صاحب کانال کپی و تغییر ویدیو را منع میکند. قاب رسمی و رایگانبودن metadata بهتنهایی clearance تمام حقوق مدرس/کتاب نیست. صدا، آگهی، رفتار third-party، دسترسپذیری، صحت علمیِ دقیقهبهدقیقه، حقوق embed و پخش واقعی Android/Safari باید مستقل بررسی شوند. ویدیوی۱۳۹۹ خودکار مطابق چاپ۱۴۰۵ معرفی نمیشود. هیچ «بهترین مدرس» یا تضمین فهم کامل اعلام نمیشود.
57
+
58
+## کشف عملی برای چاپ متوسطه
59
+
60
+مشکل «۱۵۵کتاب متوسطه، سال نامشخص» قابل تحقیق است؛ صفحه راهنمای عناوین، سال یک نسخه را ثابت نمیکند. HTML واقعی `advanced-search2` گزینه سال `value=1402` با متن `1405-1406` داشت. پارامتر صحیح، شناسه taxonomy است، نه خود عدد سال.
61
+
62
+جستوجوی واقعی، مثلا:
63
+
64
+```text
65
+http://www.chap.sch.ir/advanced-search2?title=&field_book_code_value=705&tid=All&field_year_tid=1402
66
+```
67
+
68
+برای چهار کد نمونه، نتیجه رسمی با HTTP200 دریافت شد؛ فیلد دقیق `field-name-field-book-code` و `field-name-field-year` از **صفحه جزئیات** کنترل شد. PDF هر چهار مورد واقعاً دریافت شد، هفت صفحه اول به متن تبدیل و چاپ۱۴۰۵ در شناسنامه خوانده شد؛ کل محتوای متوسطه/همه تمرینها یا ویدیوها بازبینی نشدند.
69
+
70
+| کد / کتاب | رکورد رسمی / پیوند PDF | شناسنامه خواندهشده | بایت / SHA256 PDF |
71
+|---|---|---|---|
72
+|۷۰۵، ریاضی هفتم|[14199](http://www.chap.sch.ir/books/14199) / [C705](http://www.chap.sch.ir/sites/default/files/lbooks/1405-1406/555/C705.pdf)|۱۴۰۵–۱۴۰۶؛ چاپ چهاردهم۱۴۰۵|35916566 / `bd29fabf28a0d9e36e18a47f4ad2940f901d85a8821c44ce09302fcfad847cb4`|
73
+|۹۰۵، ریاضی نهم|[14240](http://www.chap.sch.ir/books/14240) / [C905](http://www.chap.sch.ir/sites/default/files/lbooks/1405-1406/556/C905.pdf)|۱۴۰۵–۱۴۰۶؛ چاپ دوازدهم۱۴۰۵|13880696 / `8dcb86452aec1cb9ddcb7be86b1a398e1023788119647261bb1d0c59bb088592`|
74
+|۱۱۰۲۱۱، ریاضی۱|[14259](http://www.chap.sch.ir/books/14259) / [C110211](http://www.chap.sch.ir/sites/default/files/lbooks/1405-1406/40/C110211.pdf)|۱۴۰۵–۱۴۰۶؛ چاپ یازدهم۱۴۰۵|7823669 / `e20ccb8cb88c75dab899ffb9c69801557e5327522044e97c0223840be83da59d`|
75
+|۱۱۲۲۱۱، ریاضی۳|[14359](http://www.chap.sch.ir/books/14359) / [C112211](http://www.chap.sch.ir/sites/default/files/lbooks/1405-1406/712/C112211.pdf)|۱۴۰۵–۱۴۰۶؛ چاپ نهم۱۴۰۵|11403137 / `bc1b9a3e2e8934025c464672cf0678ffcd7bf20fa2ad39ff14cb397881b1209c`|
76
+
77
+جستوجوی کد۷۰۵ همچنین کتاب استثنایی۵۷۰۵۱ و۹۰۵ کتاب۵۹۰۵۱ را برمیگرداند؛ اینها **بهدلیل عدم برابری دقیق کد حذف شدند**. نتیجه قدیمی/لینک ثابت تبلیغی۱۳۰۷۸ نیز جای نسخه انتخابشده نیست. اولین نتیجه یا یافتن زیررشته کد معیار پذیرش نیست.
78
+
79
+راهبرد batch قابل استفاده:
80
+
81
+1. یکبار HTML فرم جاری را دریافت و mapping متن سال→value و دوره/پایه را ثبت کن؛ `1402` را ثابت همیشگی فرض نکن.
82
+2. برای هر کد موجود در کاتالوگ، جستوجوی محدود به سال انتخابی و در صورت نیاز پایه/رشته انجام بده؛ صفحهبندی نتایج را بخوان، concurrency پایین و timeout داشته باش.
83
+3. هر صفحه جزئیات نامزد را دریافت کن؛ **برابری دقیق کد، سال، نوع استاندارد/استثنایی/آزمایشی، پایه و رشته** را بررسی کن. چند نامزد معتبر مساوی به بازبینی دستی میروند، نه انتخاب بیصدا.
84
+4. فایل رسمی ضمیمه و شناسنامه چاپ را بررسی کن؛ status، URL، زمان، byte-count/hash و محدوده PDF واقعاً دیدهشده را در receipt جدا ذخیره کن. محتوای HTML/پیشنمایش عمومی اثبات تمام فایل نیست.
85
+5. ابتدا فقط پیشنهاد اصلاح JSON/receipt را تولید کن. واحدهای provider_index و ویدیوها همچنان UNVERIFIED/DRAFT میمانند. سال جدید stableBookKey و شناسههای جدید میسازد؛ نباید ارتباط تاریخچه/برنامه و حذف یا کنارگذاری نسخه `unknown` را خودکار حدس زد.
86
+6. reviewer diff را تأیید کند، importer محلی با migrator و داده ساختگی اجرا/تکرار/بازیابی شود، و نسخه قدیمی بدون خرابکردن تاریخچه کنار گذاشته شود. تغییر زنده نیازمند مجوز جدا است.
87
+
88
+این چهار مشاهده به تمام۱۵۵کتاب تعمیم داده نشدهاند؛ کاتالوگ اصلی متوسطه تغییر نکرد. سایر کدها، رشتهها، هنرجویان فنی/حرفهای، چاپهای آزمایشی و تطبیق همه واحدها هنوز باز هستند.
89
+
90
+## بررسی اجرایی همین فایل پیشنویس
91
+
92
+واقعاً اجرا شد: JSON parse، `validateAssessmentDefinition` و `gradeAssessment` موجود پروژه برای۱۰پرسش اصلی و۳پرسش بازیابی. پاسخهای مطابق کلید۱۰/۱۰ و۳/۳ و پاسخ متفاوت از کلید۰/۱۰ و۰/۳ برگشت؛ markerهای DRAFT و `reviewRecord:null` و `fullVideoWatched:false` کنترل شدند. این آزمون فقط سازگاری schema/نمرهدهی نرمافزار است، **نه صحتسنجی مستقل آموزشی کلیدها، اعتبار سنجش یا انتشار**. hash بانکها در همان اجرا:
93
+
94
+- بانک اولیه: `9684fbb4ee02bdf081bfde50172017b88ebc9f247efa106edb369a194cdf07e2`
95
+- بازیابی: `a165b38c22c09077ef3c3dc7a2bec7d541512d93e0ef7d658013526b9c3661ee`
96
+
97
+پرسش شمارش نخست در بازخوانی پیشنویس اصلاح شد تا خود صورتسؤال تعداد پاسخ را نگوید. بازبین مستقل باید هر prompt/گزینه انحرافی، جهتنمای ردیف در RTL، خوانایی، توضیح و تمرین اصلاحی را بررسی کند. این اصلاح داخلی جای review مستقل نیست.
98
+
99
+دروازههای باز: معلم واجد صلاحیت پایه اول، بازبینی مستقل بانک/گزینهها، تماشای۳۳:۱۴دقیقه محتوای هر چهار فیلم و ثبت همه خطا/جاافتادگی، تطبیق چاپ جاری، حقوق نشر، آزمایش تصویری/خواندن با کودک و رضایت لازم، دسترسپذیری/دستگاه/ایران، و مشاهده انتقال تأخیری. تا آن زمان draft به published تبدیل نمیشود. هیچ private chat/یادداشت/سلامت/افشای آزار در محتوا یا پژوهش استفاده نشده است؛ AI خارجی، ارسال خودکار داده و اعلان به اشخاص اجرا نشد.
docs/superpowers/plans/2026-10-11-content-operations.md
new
+23
@@ -0,0 +1,23 @@
1
+# LifeGuide — content operations implementation plan
2
+
3
+> Execute the already authorized local work. Do not request approval for routine reversible implementation choices; preserve explicit live/release restrictions.
4
+
5
+**Goal:** deliver a real consented feedback-to-research workflow and improve existing learning interfaces without rebuilding the shared backend.
6
+
7
+**Architecture:** Express/PostgreSQL explicit capability grants, server-side version/idempotency/consent checks, Flutter runtime API, account/endpoint mutation journal and online-only restricted inbox. No external AI or private-data extraction.
8
+
9
+**Stack:** Node22, PostgreSQL16, Flutter3.47.6, compiled Chromium substitutes and existing Compose TLS/backup package.
10
+
11
+- [x] Read AGENTS.md/PROJECT_STATE.md and audit remaining code against actual state.
12
+- [x] Define scoped capabilities, transitions, journal/brief payloads and withdrawal behavior.
13
+- [ ] Backend RED: unauthorized parent, consent/withdrawal, stale updates, lost acknowledgement, expiry/revocation, bounded listing and private-free brief cases.
14
+- [ ] Backend GREEN: migration0016, dedicated review router, role policy and local synthetic-only capability CLI.
15
+- [ ] Client RED/GREEN: inbox/filter/status/brief, namespace invalidation and exact retry acknowledgement; owner review/history page; status accessibility.
16
+- [ ] Root integration: actual-capability menu, learning history route, versions/docs.
17
+- [ ] Research: latest official grade1 math pages, original draft teaching/questions, media shortlist with all unreviewed gates explicit; no download/rehosting or false publication.
18
+- [ ] Complete bounded independent report/remaining engineering tasks, document policy and acceptance separately.
19
+- [ ] Run pinned Node22 migrations/repeat/role isolation/restore and full backend tests; full Flutter/analyzer; one frozen-source web build and actual local HTTPS/browser substitutes.
20
+- [ ] Review code, secret/naming/diff checks, record exact outputs and UNVERIFIED hardware/live/content gates.
21
+- [ ] Small commits, feature PR, actual CI/debug artifact receipts and current handover. No merge/deploy/public release.
22
+
23
+Detailed acceptance is in the matching design and completion-gap audit. A failed or unrun check is not green. Historical0.6 receipts certify their recorded source only.
docs/superpowers/plans/2026-10-11-content-publication-tool.md
new
+16
@@ -0,0 +1,16 @@
1
+# Content publication tool execution
2
+
3
+1. RED: exact manifest/receipt/input and local-only connection tests; PostgreSQL
4
+ dry-run purity, stale context/hash, missing full-review flags and replay tests.
5
+2. Add0020 identifier/hash-only audit journal and no new HTTP router.
6
+3. Implement current-context inspection, full gate validation, catalogue-lock
7
+ transactions and synthetic-fixture-only application/withdrawal.
8
+4. Add original assessment draft/revision with stable IDs, recomputed hashes,
9
+ published-definition protection and retained attempt snapshots.
10
+5. Implement a CLI that reads JSON from a file, prints safe structural receipts
11
+ and never logs credentials or raw driver errors. No media fetching occurs.
12
+6. GREEN: focused Node22 real PostgreSQL tests, scoped syntax, actual CLI
13
+ invocation, repeated operation replay, runtime/backup denial and no audit
14
+ text fields. Coordinator runs integrated migrations/suite/role restore.
15
+7. Document exact manual inspect/dry-run commands and explain that this build's
16
+ apply mode supports synthetic fixtures only. Keep pilot review:null/draft.
docs/superpowers/plans/2026-10-11-family-lifecycle.md
new
+41
@@ -0,0 +1,41 @@
1
+# Family lifecycle implementation plan
2
+
3
+1. Inspect existing invite/accept/remove locks and sharing policies.
4
+2. RED validation/HTTP tests; add migration0018 membership/invitation revisions
5
+ and metadata-only stable mutation ledger.
6
+3. Implement dedicated administrator-only lifecycle router, scoped read and
7
+ current-state retry after transfer; root mounts it and adjusts expiry checks.
8
+4. Run real local HTTP/PostgreSQL race, restart and privacy tests; root integrates
9
+ runtime-role policy/complete suite/client acceptance.
10
+5. Document exact outputs and remaining hardware/live/age-assurance limits.
11
+
12
+One backend owner; root exclusively owns shared server and DB role integration.
13
+
14
+Execution on2026-10-11 (local synthetic PostgreSQL16, Node22.23.3):
15
+
16
+- RED: the genuinely lock-blocked JWT-expiry request incorrectly returned200
17
+ instead of401; reciprocal writes across two families returned500/200 instead
18
+ of200/200 with actor-first account locks.
19
+- GREEN: ordered account/profile/membership locks and final locked-session plus
20
+ fresh-time JWT check passed both regressions,2/2.
21
+- Final focused command, `node --test tests/family_lifecycle.test.js
22
+ tests/family_lifecycle_validation.test.js`, passed **21/21**, zero failures,
23
+ cancellations or skips,3690.98ms. This includes root-owned creation, legacy
24
+ helper and acceptance final-session guards; API restart, current-state/hash
25
+ retry, CAS, privacy, one-admin races, removal/rejoin, birth-date edits, and
26
+ expiry/revocation while actual database locks are held.
27
+- The project command `node scripts/test.js` also ran:215 tests,214 passed,
28
+ one failed,44818.13ms. The named failure was
29
+ `profile_category.test.js:148`, learning-goal malformed-subject compatibility:
30
+ expected `invalid_subject_id`, received `invalid_input`. The separate goal
31
+ owner and root received the complete result; this is not a green whole-suite
32
+ claim. This aggregate preceded the final two focused family regressions.
33
+- Migration0018 was applied through the real migration runner. That runner also
34
+ saw and applied draft0019 in the shared synthetic fixture; no stored checksum
35
+ was edited. A fresh integrated database with all final frozen migrations is
36
+ required for final handover. No live database or canonical role credential was
37
+ changed.
38
+
39
+This agent did not run an APK/web build, runtime-role restore drill, physical
40
+Android/Safari acceptance, or live migration/deploy. Those are **UNVERIFIED** for
41
+this packet until root records independent execution.
docs/superpowers/plans/2026-10-11-learning-goal-lifecycle.md
new
+26
@@ -0,0 +1,26 @@
1
+# Private learning goal lifecycle
2
+
3
+Scope: existing PostgreSQL learning goals, not new AI/wellbeing or sharing.
4
+
5
+1. Add migration0017: monotonically versioned goals, nullable archived timestamp,
6
+ owner-scoped mutation UUID/request-hash ledger with durable applied version.
7
+2. Preserve unversioned HTTP clients; their edits also advance goal version.
8
+ Modern create supplies stable goal UUID + mutation UUID + expectedVersion0;
9
+ modern edit/archive requires expectedVersion and rejects stale writes409.
10
+3. Serialize all goal writes by active account row and goal row. Owner checks
11
+ apply on every read/write; guardian membership never grants private goals.
12
+ Legacy nonowner reads keep concealed404. Modern foreign-ID writes return403.
13
+4. Replay an accepted request with the same hash without duplicate writes.
14
+ Return the current goal, including an archived tombstone, and original
15
+ mutation acknowledgement. A reused UUID with another body fails409.
16
+ Keep linked learning check-in history; archive never deletes it.
17
+5. Flutter HTTP screen: create/read/edit/complete/archive with explicit errors,
18
+ pending intent and manual sync. Persist intent before sending, validate exact
19
+ mutation/account/goal/version acknowledgement, namespace by API+account.
20
+ Unacknowledged or conflicted writes remain recoverable. FakeAPI hub remains
21
+ available only to existing explicit test clients.
22
+6. RED/GREEN: real local synthetic PostgreSQL HTTP restart/replay, concurrent
23
+ stale writes, subject ownership, guardian/other-family denial, archived retry;
24
+ widget/offline tests for lost acknowledgement, reopen, errors and isolation.
25
+
26
+Publication/deployment, real device acceptance and foreign data are out of scope.
docs/superpowers/plans/2026-10-11-school-lifecycle.md
new
+12
@@ -0,0 +1,12 @@
1
+# School lifecycle implementation plan
2
+
3
+> Use the existing Node/PostgreSQL and Flutter offline infrastructure. Do not deploy or change live access.
4
+
5
+- [ ] Write a failing real-entrypoint lifecycle test and record the 404 baseline.
6
+- [ ] Add migration0019 with versions, term active state, account-scoped mutation ledger and legacy-path database guards.
7
+- [ ] Add owner-only lifecycle router with bounded input/list, idempotency, CAS and archival.
8
+- [ ] Run real PostgreSQL lifecycle tests and legacy subject/class regression checks.
9
+- [ ] Write Flutter failing tests for explicit setup and durable exact-body retries.
10
+- [ ] Add scoped lifecycle mutation helper and Persian RTL management screen; integrate only SchoolPage.
11
+- [ ] Run focused Flutter tests/analyzer and report exact output to coordinating lead.
12
+- [ ] Lead integrates router/role policy, runs aggregate/Compose/build/CI checks and updates delivery evidence.
docs/superpowers/specs/2026-10-11-content-operations-design.md
new
+31
@@ -0,0 +1,31 @@
1
+# LifeGuide — consented content operations
2
+
3
+Date: 2026-10-11. Authorized scope: local code, synthetic tests, documentation and feature PRs. Production grants, publishing, external messages, deployment and real data are outside this packet.
4
+
5
+## Problem and acceptance
6
+
7
+The existing feedback API stores an explicitly chosen learner summary and supports withdrawal, but has no working review inbox or development brief. Family membership must never confer platform-content authority. Implement a real PostgreSQL-backed workflow with independent capabilities, versioned status updates, durable retry acknowledgement and a Persian operator interface. Preserve catalogue publication gates; feedback approval does not publish media or assessments.
8
+
9
+Acceptance: an ordinary parent is denied; a synthetic explicitly granted operator can list consented summaries, triage one, plan it and prepare a metadata-only brief. Withdrawal, expired/revoked grants and stale versions close access. A lost acknowledgement can be retried without repeating a mutation. Closing/reopening retains only mutation intent metadata; summaries and grants are not cached. A brief must be revalidated before copying and becomes unavailable after any source withdrawal/change. Tests must run against real synthetic PostgreSQL and widget/browser substitutes, with actual devices labelled UNVERIFIED.
10
+
11
+## Contract
12
+
13
+- `GET /v1/me/content-capabilities`: `{permissions:[]}` by default. Explicit grants: `feedback.read`, `feedback.review`, `brief.prepare`. No role inference or HTTP grant route. Separate local-only synthetic capability CLI; runtime DB role can only read the grant table.
14
+- `GET /v1/content-review/feedback`: bounded UUID cursor pagination and allowlisted status, only currently consented/unwithdrawn rows; return id, public unit id, category, chosen summary, status, version and timestamps. Never owner id, contact information, chat, health, notes or profile.
15
+- `PATCH /v1/content-review/feedback/:id`: `{mutationId,expectedVersion,status}`. Transitions: received → triaged/declined; triaged → planned/declined; planned → triaged/declined; declined → triaged. `released` is not writable. Compare-and-swap, actor-scoped request hash ledger and exact server acknowledgement. Replays return current state; withdrawal wins. Missing/withdrawn rows 404, stale/invalid transitions 409.
16
+- `POST /v1/content-review/briefs`: `{mutationId,feedback:[{id,expectedVersion}]}`; at most20 currently planned, consented sources. Requires read and brief capabilities. Output contains only public catalogue context, category counts and fixed research task text; no submitted/reviewer free text or feedback/contact/owner identifiers. Public unit identifiers are allowed.
17
+- `GET /v1/content-review/briefs/:id`: re-check current permissions and source status/version/consent; invalidated briefs return409, never their old payload. Store a restricted source linkage internally, not in exported output.
18
+
19
+## Safety and client behavior
20
+
21
+Check grants on every request and lock consistently with revocation and withdrawal. Audit identifiers, actor and status changes rather than user text. Existing private learning progress/attempts remain owner-only. The UI loads actual capabilities and defaults to hidden; it never substitutes parent/admin membership. The inbox is online-only, memory-only, clears on failed refresh/auth/revocation, and rejects late responses across identity/endpoint generations. Review mutation journals store only IDs, versions, status and stable UUIDs in the existing account/endpoint namespace. Explicit retry reuses the identical body; no automatic offline moderation.
22
+
23
+The brief is a research starting point, not a diagnosis, an instruction to deploy or evidence that requested teaching is correct. Copying cannot magically revoke a previously copied document; the runbook must require revalidation and avoid storing personal text. External AI/messages and autonomous publication stay disabled. Full video viewing, rights, current textbook mapping and qualified assessment review remain separate publication gates.
24
+
25
+## Coordinated ownership
26
+
27
+Backend content-operations specialist owns migration0016, dedicated router, capability CLI and DB policy. Client specialist owns new content-review UI/journal. Accessibility specialist owns existing education status semantics. Research specialist owns a draft grade1 math pilot and source evidence. Root owns integration, shared docs/version, full verification, commits and PR. Independent audit and reporting tasks use separate files.
28
+
29
+## Remaining local work
30
+
31
+Follow the completion-gap audit: owner review/history UI, explicit report periods, goal retry/version contract and CRUD interface, school setup/lifecycle, family lifecycle and safe offline shell. These are engineering tasks, not proof of a fully reviewed first-through-twelfth-grade school or real Safari/device acceptance.
docs/superpowers/specs/2026-10-11-content-publication-tool-design.md
new
+41
@@ -0,0 +1,41 @@
1
+# Local content review and publication tooling
2
+
3
+This package prepares the existing0013/0015 publication gates for explicit,
4
+reviewable operation. It does not approve school material or deploy anything.
5
+
6
+`inspect` reads current catalogue context and hashes. `dry-run` validates an
7
+exact JSON operation against that context in a read-only transaction. `apply`
8
+requires a separate `CONTENT_REVIEW_DATABASE_URL`, an explicit
9
+`CONTENT_REVIEW_SYNTHETIC_ONLY=true` flag and a loopback, explicitly named test
10
+database. Apply further requires a `synthetic-publication:` book fixture and,
11
+for publication, an explicitly marked synthetic reviewer receipt. Existing
12
+research material and the real mathematics pilot remain draft.
13
+
14
+Video publication compares the expected metadata material hash and freshly
15
+computed book/unit context hash, then validates every existing full-review,
16
+rights, suitability and question-coverage field. This metadata hash does not
17
+prove the bytes hosted by the provider have remained unchanged. No media is
18
+downloaded, observed or approved by this tool.
19
+
20
+Assessment drafting creates a stable UUID/version1 definition or revises an
21
+existing draft/withdrawn definition with the next version and recomputed
22
+question/context hashes. A published definition cannot be edited. Withdrawal
23
+preserves learner attempts and question snapshots. Publishing requires a
24
+complete matching accuracy/objective/suitability receipt and a verified current
25
+book edition. No automated content creation or review claims are made.
26
+
27
+All writes share the catalogue-import advisory lock and lock catalogue context
28
+plus target rows. A stable operation UUID and canonical request hash provide
29
+durable exact replay. Replays return the current state: a later withdrawal or
30
+revision dominates an older publish receipt. Stale status/hash/version and
31
+reused operation IDs fail without mutation. Dry-run never inserts audit rows.
32
+
33
+Migration0020 adds only `content_publication_audit`, an identifier/hash/status
34
+mutation journal. It contains no feedback summaries, chats, notes, health data
35
+or reviewer prose. The HTTP runtime/backup cannot write it or teaching tables;
36
+only the separate operator/migrator can. No public review/grant endpoint exists.
37
+
38
+Tests use a new disposable local PostgreSQL database with stable migrations
39
+0001–0015 plus0020, independent of concurrent schema work. Full integrated
40
+migrations, runtime policy, builds and real device verification remain the
41
+coordinator's checks. Real human content approval remains UNVERIFIED.
docs/superpowers/specs/2026-10-11-family-lifecycle-design.md
new
+52
@@ -0,0 +1,52 @@
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.
docs/superpowers/specs/2026-10-11-offline-startup-design.md
new
+7
@@ -0,0 +1,7 @@
1
+# LifeGuide — safe offline startup notice
2
+
3
+An installed/warmed PWA currently fails cold navigation without a network. Add a small public Persian RTL offline document to the existing worker. It requires no Flutter engine, API configuration, credentials or personal cache. It clearly says that fresh login/data require connection, does not read or erase pending work and offers manual retry. This is a dependable offline startup notice, not authenticated offline access or proof that Safari storage eviction is solved.
4
+
5
+Install fetches only this public document with omitted credentials. Eligible same-origin GET document navigation tries the network first and falls back only on network failure. API/config/auth/resource navigation never receives the HTML fallback. Worker caches no authenticated responses, URL query payloads or user data. Versioned cache retirement preserves other application stores. Static resources retain the existing network-first behavior. A normal online navigation always loads current code/settings, preventing an old-cache lock-in.
6
+
7
+Acceptance: unit execution of actual worker source verifies install, navigation fallback, API/config/auth exclusions and online precedence; final compiled Chromium over local trusted HTTPS verifies warm install → browser close → network offline → public notice → reconnect → current login/data. Real Safari/install/eviction remains UNVERIFIED. No live deployment is authorized.
docs/superpowers/specs/2026-10-11-school-lifecycle-design.md
new
+23
@@ -0,0 +1,23 @@
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.