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 92 lines 6.45 KB
Rendered Raw
1 # Supabase LifeGuide-QA provisioning and private probe — 2026-10-15
2
3 Status: **QA database provisioned; integration not deployed**. Evidence here comes from actual connected Supabase tool responses, not from a user/device test.
4
5 ## Scope, authorization and cost
6
7 Owner chose a general-purpose Supabase organization **DM Studio**, with each software product as a separate project. Organization list after reconnect confirms:
8 - Organization `DM Studio`, ID `unrlckipyubhegrpqgei`, plan `free`.
9 - Existing project `Finora ERP – Production`, ID `hcsixhqbyuhpshfwqpjx`, reported `ACTIVE_HEALTHY`. No writes or changes to it.
10 - `get_cost(type=project, organization_id=unrlckipyubhegrpqgei)` returned `{"type":"project","recurrence":"monthly","amount":0}`. Zero-cost confirmation obtained in the connector; no card/purchase/upgrade was submitted. Free-tier project limit and pauses remain provider constraints. The provider successfully admitted the project.
11
12 Actual new project:
13 - Name: **LifeGuide-QA**
14 - Supabase project ID: `iqkrwxeprxvdiubdfcrb`
15 - Organization ID: `unrlckipyubhegrpqgei`
16 - Region: `eu-central-1` (Frankfurt)
17 - Status after provision: **ACTIVE_HEALTHY**
18 - PostgreSQL: **17.11**
19 - Project API base: `https://iqkrwxeprxvdiubdfcrb.supabase.co`. This is **NOT** the old LifeGuide Express REST API or the PWA address; Flutter must **not** be switched to this URL.
20
21 ## Actual QA write and security verification
22
23 At first inspection:
24 - `public` application tables: **0**.
25 - Supabase migration list: empty; Edge Functions list: empty.
26 - PostgreSQL `pgcrypto` already installed in `extensions`.
27 - Initial Supabase security/performance advisors: no findings.
28
29 Applied **one additive migration** through the Supabase migration tool: `20261014210221_lifeguide_qa_isolated_connectivity_baseline`.
30 Source mirror: `supabase/migrations/20261014210221_lifeguide_qa_isolated_connectivity_baseline.sql`.
31
32 This migration created only:
33 - private schema `lifeguide_qa`
34 - table `lifeguide_qa.setup_probe`, containing a UUID, **synthetic-only** probe name, timestamp
35 - RLS enabled and forced; explicit **no `anon` or `authenticated` schema/table grants**, and no RLS policies (deliberately deny all).
36 - No public tables, no credentials, no parent/child identities, and no production content.
37
38 Database write performed:
39 ```sql
40 insert into lifeguide_qa.setup_probe(probe_name)
41 values ('synthetic_backend_handshake')
42 on conflict (probe_name) do update set probe_name=excluded.probe_name
43 returning probe_name, created_at;
44 ```
45 This returned exactly one synthetic record. A separate read-only SQL verification returned:
46
47 | Check | Observed |
48 | --- | --- |
49 | synthetic_receipts | 1 |
50 | public_app_tables | 0 |
51 | qa_tables | 1 |
52 | anon_schema_usage | false |
53 | authenticated_schema_usage | false |
54 | anon_table_select | false |
55 | authenticated_table_select | false |
56 | rls_enabled | true |
57 | rls_forced | true |
58
59 Post-migration security advisor: one **INFO** `rls_enabled_no_policy` finding for `lifeguide_qa.setup_probe`; this is **expected by design** because the private setup table has no policies and client access is intentionally denied. This is not a permission leak. If this table is ever repurposed as an application table, explicit restrictive policies and negative authorization tests become mandatory.
60
61 Remediation reference: https://supabase.com/docs/guides/database/database-linter?lint=0008_rls_enabled_no_policy
62
63 ## JWT-protected Edge runtime probe — verified
64
65 A single synthetic-only Edge Function was deployed:
66 - slug `lifeguide-qa-health`, function ID `1f9a5c60-7f37-4bfa-ae68-663e46875dc1`
67 - status `ACTIVE`, version `1`, `verify_jwt=true`, no database calls, no credentials, no real data, and GET-only JSON response.
68 - GitHub source: `supabase/functions/lifeguide-qa-health/index.ts` and `deno.json`.
69 - An unauthenticated HTTP GET from an external fetch service to `https://iqkrwxeprxvdiubdfcrb.supabase.co/functions/v1/lifeguide-qa-health` was **HTTP 401**, as intended. This is a real negative access test, **not** proof of an authenticated 200 or of parent/child policy.
70 - The function is strictly a private QA runtime proof, **not** the existing Node/Express v0.7.1 `/api`, PWA deployment or Android backend.
71
72 The existing `Finora ERP – Production` project remained listed as `ACTIVE_HEALTHY` after QA provisioning. No writes to it were made by this workstream.
73
74 ## Compatibility conclusion and remaining gates
75
76 Existing LifeGuide v0.7.1:
77 - Backend is **Node >=22 / Express 5**, with native `argon2`, `pg`, bespoke JWT/session auth, rate limiting and backup/role scripts.
78 - Original 20 PostgreSQL migrations are intended for a self-hosted PostgreSQL 16 instance with distinct bootstrap, API, migrator and backup roles; provisioner expects schema ownership/role topology that must not be applied without adapting to Supabase Postgres 17 managed role model.
79 - Supabase PostgreSQL gives the right SQL family and `pgcrypto`, **but Supabase itself does not run the existing long-lived Express server**. Need an approved adapter strategy: independent Express host, or a scoped Edge Functions implementation with consent and permission parity. Calling the Supabase project URL the existing `/api` would be incorrect.
80 - There is **no** PWA/Android application integration, no `LifeGuide` application data schema, no 20 app migrations, no Auth/API adapter, no Edge Function and no public app deployment.
81 - Must confirm internet reachability and permitted usage from inside Iran without VPN. Free project inactivity pause, quotas and synthetic-data export/backup remain open.
82 - Required vertical slice: child task save/close/reopen → authorized mother/father report → unauthorized reader denied → correct duration in seconds → offline resend without duplicate.
83 - Existing `docs/decisions/0009-provider-neutral-hosting.md` remains production baseline. This isolated QA experiment **does not authorize** changing DNS, live deployments, real-data import, production DB roles, app signing or merging main/PR #10–13.
84
85 ## Next implementation milestone
86
87 1. Prepare an explicit **backend+auth compatibility matrix** from source and managed DB role capabilities.
88 2. Choose one secure, reversible API strategy, keeping existing family-authorizations intact.
89 3. Only then apply reviewed **synthetic-only** application migrations and build an authenticated API vertical slice.
90 4. Validate real Android + PWA devices and no-VPN reachability independently. Do not report these as complete beforehand.
91
92 Owner action currently needed: **none** for the already provisioned QA database; no payment card needed.