Skip to content

feat: EPIC-05 — Future Self Prediction + Identity Persona Reveal#33

Open
UTA0619 wants to merge 2 commits into
mainfrom
feature/epic-05-future-self
Open

feat: EPIC-05 — Future Self Prediction + Identity Persona Reveal#33
UTA0619 wants to merge 2 commits into
mainfrom
feature/epic-05-future-self

Conversation

@UTA0619
Copy link
Copy Markdown
Owner

@UTA0619 UTA0619 commented May 12, 2026

EPIC-05: Future Self Prediction

Closes #9


The Moment

This is ECHO//SELF's signature feature — the dramatic identity reveal. A locked card that the user taps to flip open, revealing their AI-generated future persona.


Flow

User has 5+ entries
    → FutureSelfScreen loads prediction from DB
    → PersonaCard renders in LOCKED state (rotating symbol)
    → User taps → predictionReveal haptic fires
    → Card flips (rotateY 0→360°) with glow
    → Archetype revealed: emoji + label + ConfidenceRing
    → Persona name + description fades in
    → After 800ms: TraitShiftRow cascade (120ms stagger each)

Components

Component Description
PersonaCard rotateY flip · archetype glow · ConfidenceRing · persona reveal
ConfidenceRing SVG animated circle · strokeDashoffset → confidence%
TraitShiftRow from→to shift · magnitude bar · direction color coding
archetypeConfig 8 archetypes: visionary/healer/creator/rebel/sage/explorer/guardian/alchemist

8 Archetypes

Visionary 🌌 · Healer 🌸 · Creator 🎨 · Rebel 🔥 · Sage 🦉 · Explorer 🧭 · Guardian 🛡️ · Alchemist ⚗️

Next

→ EPIC-06: Stripe Subscription + Profile Screen (Issue #10)

…a Reveal

Implements Issue #9 — AI-generated identity persona

Screens:
- FutureSelfScreen: locked → reveal → traits cascade flow
  Loading state, error state, empty state (min 5 entries gate)
  Days-since-prediction refresh hint, regen button

Components:
- PersonaCard: card flip animation (rotateY 0→360°), glow shadow,
  archetype header + ConfidenceRing, persona name + description
  Locked face: rotating symbol, tap-to-reveal CTA
- ConfidenceRing: SVG animated circle (Animated.createAnimatedComponent),
  strokeDashoffset progress from 0→confidence% over 1400ms
- TraitShiftRow: from→to trait shift with magnitude bar animation,
  direction color coding (growth/healing/transformation/integration)
- archetypeConfig.ts: 8 archetypes with primary/secondary colors,
  gradient pairs, emoji, tagline, symbol

Store (futureSelf.ts):
- loadPrediction: fetch latest from future_self_predictions table
- generatePrediction: invoke generate-future-self edge fn
- isRevealed: persisted across sessions (AsyncStorage)
- FutureSelfPrediction type: persona, traits, confidence, archetype

Closes #9
apps/mobile/src/screens/future/FutureSelfScreen.tsx:
  - Loads prediction from `future_self_predictions` table via futureSelf store
  - PersonaCard with animated reveal mechanic (setRevealed)
  - TraitShiftRow list for all key trait shifts
  - Confidence, entry count, horizon metadata row
  - Share (native Share API) + Regenerate actions
  - LoadingState / IdleState / ErrorState as separate hoisted components
  - Pull-to-refresh via RefreshControl

supabase/functions/update-future-self/index.ts:
  - Cron/manual POST handler, auth via CRON_SECRET
  - Queries all premium users with >= 20 memories
  - Generates 30d/90d/365d predictions in parallel (Promise.allSettled)
  - GPT-4o prompt returns: personaName, description, keyTraitShifts,
    confidenceScore, visualArchetype, shareSnippet
  - Upserts on (user_id, time_horizon) conflict key

packages/shared-types/:
  - Added VisualArchetype union type (8 archetypes matching archetypeConfig.ts)
  - Full shared type set: EmotionType, Entry, Memory, User, Subscription,
    Prediction, IdentityNode, OnboardingData

Monorepo scaffolding (same as epic-04 branch):
  - package.json, pnpm-workspace.yaml, apps/mobile/package.json
  - apps/mobile/src/services/supabase.ts (singleton client)
  - apps/mobile/src/theme/tokens.ts + haptics.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Daily Entry Input — Voice & Text

1 participant