LifeMate — Personal, Family & Learning Companion

main
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 4 KB

Phase 5 Hardening & Release Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Harden LifeMate operationally and make the existing Android/Web/PWA/API stack release-ready without performing a production release.

Architecture: Preserve the current Flutter + Node/Express + PostgreSQL architecture. Add focused backend middleware, CI restore verification and operational documentation; keep production-sensitive AI/voice gates disabled.

Tech Stack: Node 22, Express 5, PostgreSQL, Flutter, GitHub Actions, Railway staging.

Spec: docs/superpowers/specs/2026-10-05-phase-5-hardening-release-design.md

Global Constraints

  • No production deploy/public release without explicit approval.
  • Never log secrets, auth headers, passwords, wellbeing notes or AI transcripts.
  • General rate limit default 120/min/IP; auth 10/10min/IP; AI 30/10min/identity-or-IP.
  • /live is process-only; /ready verifies database connectivity; /health remains compatible.
  • Existing Phase 1–4 behavior and tests must remain green.

Review Focus

  • Proxy/IP handling must not let a caller trivially bypass limits.
  • Rate limiting must not break test suites or CORS preflight.
  • Error logging must not serialize request bodies or credentials.
  • Readiness must return non-2xx when PostgreSQL is unavailable.
  • Backup/restore drill must prove data, not merely schema creation.

Task 1: Backend hardening middleware

Files: create backend/src/operations.js; create backend/tests/operations.test.js; modify backend/src/server.js; modify backend/package.json. Produces: request correlation, security headers, JSON telemetry, /live, /ready, and configurable rate limiting. - [ ] Add failing operations tests for headers/request ID/rate limits/readiness/log redaction. - [ ] Verify CI failure on tests before implementation. - [ ] Implement minimal operations middleware and wire it into server. - [ ] Run backend tests/check/audit to green.

Task 2: Backup/restore drill

Files: create backend/scripts/backup.sh; create backend/scripts/restore.sh; create backend/scripts/restore-smoke.sql; modify .github/workflows/ci.yml. Produces: repeatable native PostgreSQL backup/restore commands and CI data round-trip gate. - [ ] Add CI restore-drill gate that fails until scripts exist. - [ ] Implement scripts and representative smoke data assertion. - [ ] Verify CI restore drill green.

Task 3: Release/incident operations documentation

Files: create docs/operations/DEPLOYMENT.md, ROLLBACK.md, BACKUP_RESTORE.md, INCIDENT_RESPONSE.md, PRODUCTION_CHECKLIST.md; create CHANGELOG.md; modify README.md as needed. Produces: executable runbooks and release gates. - [ ] Add contract test asserting required runbooks and mandatory safety clauses. - [ ] Implement runbooks and changelog. - [ ] Verify contract test green.

Task 4: Cross-platform release regression gates

Files: modify .github/workflows/ci.yml; add/modify Flutter tests only where needed. Produces: format/analyze/test + Web release + Android debug/release-safe build metadata + PWA manifest/accessibility smoke gates. - [ ] Add failing contract assertions for release metadata/PWA accessibility requirements. - [ ] Implement minimal manifest/index/release checks. - [ ] Verify Flutter/Web/Android CI green.

Task 5: Staging verification and project-state closeout

Files: update PROJECT_STATE.md; update Phase 5 design/decision docs if rulings occur. Produces: verified staging evidence and accurate completion record. - [ ] Deploy only to staging using existing Railway services. - [ ] Verify migration/API /live, /ready, /health and logs. - [ ] Verify final branch CI completely green. - [ ] Record exact verification evidence in PROJECT_STATE.md. - [ ] Open PR for review; do not merge or deploy production without explicit approval.