Skip to content

Steer-08: Demo Sweep — Full Aisha TKR Journey Verification & Polish

Read first: specs/sdd-mvp/14-sequence-diagrams.md, specs/sdd-mvp/00-overview.md

Context & Goal

Full end-to-end verification of Aisha's TKR journey through all 8 phases. Fix any integration issues, add missing loading states, ensure mobile responsiveness, and prepare the demo seed data. This is the final session before the TKR demo.


Backend (curaway-ai/curaway-backend)

Step 1: Demo Seed Script

Create/update scripts/seed_demo.py: - Create Aisha patient with all demographics - Grant all 4 consent purposes - Seed 14+ TKR-capable providers across 7 countries (if not already) - Seed procedure requirements for TKR in Neo4j (16 DiagnosticTest nodes) - Seed doctors with mixed data completeness (Verified/Complete/Basic) - Verify all data stores: PostgreSQL, Neo4j, Qdrant, Redis - Print summary: "Demo ready. X providers, Y doctors, Z diagnostic tests seeded."

Step 2: End-to-End Journey Test

Create tests/test_demo_journey.py (integration test): 1. Register patient → verify patient_registered event 2. Grant consent → verify consent_granted events 3. Send chat: "I need a knee replacement" → verify Intake Agent responds with procedure identification 4. Upload sample X-ray report → verify status transitions (uploaded → parsed → analyzed) 5. Verify FHIR Condition (M17.11) created from report 6. Send chat: "I have diabetes and take metformin" → verify chat extraction + EHR update 7. Check intake_progress >= threshold 8. Trigger match → verify 4-stage pipeline executes 9. Verify match results with explanations 10. Send follow-up: "Why was Apollo ranked first?" → verify Explanation Agent responds

Step 3: Edge Case Handling

Test and fix: - What happens if document upload fails? (retry logic, user notification) - What happens if Clinical Context Agent times out? (202 + QStash retry) - What happens if matching returns 0 providers? (friendly message + suggestions) - What happens if patient has no consent? (blocked with clear message) - What happens if SSE connection drops mid-matching? (reconnect + catch up)

Step 4: Performance Check

  • Verify agent response latency targets: 300ms TTFT simple, 500–800ms clinical
  • Verify document parsing: < 5s for standard PDFs
  • Verify matching pipeline: < 10s total for 4 stages
  • Add Langfuse traces for any calls exceeding targets

Backend Verification

python scripts/seed_demo.py
python -m pytest tests/test_demo_journey.py -v
# Manual walkthrough of full Aisha journey

Frontend (curaway-ai/curaway-frontend)

Step 1: Loading States Audit

Verify every async operation has a loading state: - Chat: typing indicator (3 pulsing dots) during agent processing - Document: upload progress bar → parsing spinner → analyzing pulse → complete check - Matching: stage progress indicator (4 stages with transitions) - EHR Summary: skeleton loaders on initial load - Provider cards: skeleton on match results loading

Step 2: Error States Audit

Verify every error has a user-friendly message: - Network error: "Connection lost. Retrying..." with retry button - Agent timeout: "Taking longer than expected. Still working..." - Upload failure: "Upload failed. Please try again." with retry - Match failure: "Unable to find providers. Try adjusting your preferences." - Consent required: "Please grant consent to continue." with consent link

Step 3: Mobile Responsiveness

Test on 375px width (iPhone SE): - Left panel: hidden by default, hamburger to open - Conversation: full width, messages stack properly - Provider cards: single column, scrollable - Action chips: wrap to multiple lines - File upload: works from camera roll - Right progress strip: hidden, accessible via swipe or button

Step 4: Playwright E2E Tests

Create tests/e2e/demo-journey.spec.ts: 1. Login → verify dashboard loads 2. Navigate to conversation → send message → verify agent response 3. Upload file → verify status transitions 4. Verify EHR summary updates in left panel 5. Trigger match → verify provider cards appear

Step 5: Demo Polish

  • Ensure Montserrat font loads (not falling back to system font)
  • Verify brand colors throughout (Teal #008B8B, Coral #FF7F50)
  • Remove any "MediMatch" references (search entire codebase)
  • Verify console has no errors during full journey
  • Test with slow 3G network throttling (graceful degradation)

Frontend Verification

npm run build
npx tsc --noEmit
npx playwright test tests/e2e/demo-journey.spec.ts
# Manual: full journey on desktop + mobile viewport

Checklist

  • [ ] Seed data: complete demo dataset (Aisha + providers + procedures)
  • [ ] E2E tests: 3–5 critical paths in Playwright
  • [ ] All feature flags: verify correct defaults in Flagsmith
  • [ ] Env vars: all documented in .env.example (both repos)
  • [ ] Swagger: complete and accurate for all MVP endpoints
  • [ ] Accessibility: keyboard navigation, screen reader tested
  • [ ] Performance: Lighthouse score > 80 on key pages
  • [ ] PostHog: verify events flowing for key interactions
  • [ ] Security headers: CSP, HSTS, X-Frame-Options all set
  • [ ] Health endpoint: /health returns 200 with all service statuses
  • [ ] Loading states: every async op has visual feedback
  • [ ] Error states: every error has user-friendly message
  • [ ] Mobile: tested on 375px viewport
  • [ ] No console errors during full journey
  • [ ] No "MediMatch" references anywhere
  • [ ] CLAUDE.md: final update reflecting demo-ready state
  • [ ] Rollback: document which feature flags to disable if demo issues arise