learning_ai_notes/docs
saravanakumardb1 d5e857dbf7 test(e2e): docker compose E2E test + seed scripts + 9-step verification
Implements the full E2E flow against the deployed docker stack and
documents it as a repeatable test playbook.

Surfaced and fixed three real issues while building the E2E:

1. JWT secret mismatch — docker-compose.override.yml backend was using
   a NoteLett-only JWT_SECRET that platform-service did not share, so
   every Authorization: Bearer call returned 'Invalid or expired token'.
   Aligned the override to use platform-service's actual secret
   (dev-ecosystem-secret-do-not-use-in-production).

2. CORS preflight missing PATCH/DELETE — @bytelyst/fastify-core registers
   @fastify/cors with only { origin }, which leaves Access-Control-Allow-
   Methods at the @fastify/cors default of 'GET,HEAD,POST'. Real browser
   PATCH/DELETE preflights would fail. Added an onSend hook in
   backend/src/server.ts that rewrites the header to
   'GET,HEAD,POST,PATCH,PUT,DELETE,OPTIONS' on CORS preflight responses.

3. Product 'notelett' wasn't registered with platform-service — auth
   register/login both error with 'Unknown or disabled product: notelett'.
   The seed script now POSTs to /api/products idempotently.

Deliverables:

- scripts/e2e-docker-seed.sh — idempotent: registers the notelett product
  and creates two test users (admin@notelett.app with role=admin who can
  write, user@notelett.app with role=user who is read-only). Re-runs are
  no-ops once seeded.

- scripts/e2e-docker-test.sh — 9-step E2E that drives the deployed stack
  via HTTP only (no browser): login → CORS preflight for PATCH →
  workspace create → note create → note read → note PATCH (status:
  draft→active) → note list → note delete → workspace delete.

- docs/testing/E2E_DOCKER_TESTING.md — full playbook covering prereqs,
  seed, automated E2E, manual UI smoke, stack architecture diagram,
  troubleshooting (JWT mismatch, unknown product, role rejection,
  CORS, port conflict, data loss), tear-down, CI wiring guidance.

- package.json — pnpm e2e:docker:seed and pnpm e2e:docker:test
  shortcuts.

Verified live on this host's deployed stack:

  $ bash scripts/e2e-docker-seed.sh
  ↷ product 'notelett' already exists
  ↷ admin user already registered + login works
  ✓ user created
  🟢 Seed complete.

  $ bash scripts/e2e-docker-test.sh
  ✓ user=usr_e094e0c2-... role=admin
  ✓ CORS allows PATCH
  ✓ workspace created
  ✓ note created
  ✓ note read matches
  ✓ note patched (status: draft → active)
  ✓ note list returned (1 item)
  ✓ note deleted (HTTP 204)
  ✓ workspace deleted (HTTP 204)
  🟢 All 9 E2E steps passed.

Backend regression suite still green: 380/380.
2026-05-23 01:16:19 -07:00
..
archive docs(cleanup): move historical roadmaps to docs/archive/ and update AGENTS.md 2026-05-22 23:23:50 -07:00
roadmaps docs(cleanup): move historical roadmaps to docs/archive/ and update AGENTS.md 2026-05-22 23:23:50 -07:00
runbooks docs(runbooks): add MEK rotation and secret-management runbooks 2026-05-22 23:23:38 -07:00
testing test(e2e): docker compose E2E test + seed scripts + 9-step verification 2026-05-23 01:16:19 -07:00
BACKEND_LLM_ROUTER_DECISION.md docs(backend): defer llm router adoption 2026-05-05 09:37:22 -07:00
COSMOS_DATA_OPERATIONS.md docs(data): add migration backfill plan 2026-05-05 13:48:52 -07:00
COSMOS_QUERY_REVIEW.md docs(data): add cosmos operations runbook 2026-05-05 13:38:58 -07:00
DATA_MIGRATION_AND_BACKFILL_PLAN.md docs(data): add migration backfill plan 2026-05-05 13:48:52 -07:00
DEEP_LINKS.md feat: implement WEB_AI_FAST_ROADMAP (web + backend + docs) 2026-03-31 13:00:36 -07:00
FIELD_ENCRYPTION_COVERAGE.md docs(data): add migration backfill plan 2026-05-05 13:48:52 -07:00
IMPLEMENTATION_TRACKER.md docs(cleanup): move historical roadmaps to docs/archive/ and update AGENTS.md 2026-05-22 23:23:50 -07:00
IMPORT_EXPORT_READINESS.md feat(notes): harden import export readiness 2026-05-05 12:15:11 -07:00
MEMPALACE_INTEGRATION_ROADMAP.md docs(palace): update roadmap — mark all phases complete with commit hashes + test counts 2026-04-10 10:22:42 -07:00
MOBILE_DELEGATION_ROADMAP.md docs(mobile): defer sync engine adoption 2026-05-05 09:35:47 -07:00
MOBILE_PLATFORM_SDK_DECISION.md docs(mobile): defer react native platform sdk 2026-05-05 09:34:34 -07:00
MOBILE_PRODUCTION_BUILD_AND_SMOKE.md docs(mobile): add production build smoke checklist 2026-05-05 13:23:47 -07:00
MOBILE_SYNC_DECISION.md docs(mobile): defer sync engine adoption 2026-05-05 09:35:47 -07:00
NEXT_SPRINT_ROADMAP.md docs(sprint-a): record build restoration and refreshed sprint plan 2026-05-22 15:08:42 -07:00
OPERATOR_RUNBOOK.md docs(ops): add operator runbook 2026-05-05 13:53:59 -07:00
PLATFORM_SMOKE_CHECKS.md chore(platform): add local smoke script 2026-05-05 09:29:42 -07:00
PRD.md feat(identity): lock NoteLett product identity across all surfaces 2026-03-10 18:47:01 -07:00
PRODUCTION_READINESS_HANDOFF_ROADMAP.md docs(p10.5): live shared-service smoke verified end-to-end May 23, 2026 2026-05-23 00:30:44 -07:00
RELEASE_CHECKLIST.md docs(ops): add operator runbook 2026-05-05 13:53:59 -07:00
ROADMAP.md docs(release): record final handoff status 2026-05-05 14:20:15 -07:00
SEED_BOOTSTRAP_STRATEGY.md docs(data): add migration backfill plan 2026-05-05 13:48:52 -07:00
SMART_ACTIONS_ROADMAP.md docs: update AGENTS.md test counts and SMART_ACTIONS_ROADMAP Phase 6 status (G20) 2026-04-06 13:44:41 -07:00
SMART_ACTIONS_USER_GUIDE.md feat(smart-actions): add run-stream SSE, history endpoint, weekly-digest template, web client functions (G1-G5) 2026-04-06 13:27:02 -07:00
TELEMETRY_AND_DIAGNOSTICS_TAXONOMY.md docs(ops): define telemetry taxonomy 2026-05-05 13:51:28 -07:00
UI_UX_PLATFORM_CORE_ROADMAP.md feat(ci): one-way UI drift ratchet to prevent regressions 2026-05-23 00:13:50 -07:00
UX_TESTING_SETUP_GUIDE.md feat(ux): add UX testing setup guide and common platform integration 2026-05-09 22:09:43 +00:00
WEB_AI_FAST_ROADMAP.md feat: implement WEB_AI_FAST_ROADMAP (web + backend + docs) 2026-03-31 13:00:36 -07:00