NEEDS_REVIEW_soulwise_persons
NEEDS_REVIEW_Album entries. Indexes on userId, status, deletedAt. Soft-delete first; hard-delete of PII at 30 days.
NEEDS_REVIEW_For engineers, PMs, journalists, and partnership scouts. The full pipeline, four MongoDB collections, EDA events, V-Model rigor, performance targets, security, and accessibility — all on one page.
NEEDS_REVIEW_Each step has a service, a contract, and an event.
NEEDS_REVIEW_A user action — 'generate today's chapter for Sister' — or a scheduled cron, like the Sunday 9 a.m. recap, or the every-6-hours weather refresh.
NEEDS_REVIEW_The job lands on a BullMQ queue named soulwise-chapter-generation, with a hard 28-second timeout. Long-running jobs are killed and reported as 'try again' to the user.
NEEDS_REVIEW_The ChapterGenerationService assembles the four-factor prompt — person context, astrology, signal, cadence — into a single input. No raw user PII goes into the prompt verbatim; everything is scrubbed first.
NEEDS_REVIEW_An AI provider is called via the AI_GENERATION_ADAPTER symbol token — the provider is swappable. The response is checked for length, shape, and safety before continuing.
NEEDS_REVIEW_Four things happen: a crisis classifier checks for crisis language; an aspect-chip extractor pulls one to three astrology chips; an anti-claim filter strips forbidden phrasings; the body is AES-256 encrypted with a platform-managed key.
NEEDS_REVIEW_The artifact is written to the appropriate MongoDB collection — chapters, journal entries, resonances — with userId and personId indexes for fast lookup. Soft-delete first; hard-delete of PII at 30 days.
NEEDS_REVIEW_An EventEmitter2 event — CHAPTER_COMPLETED, JOURNAL_CREATED — fires after the database commit. The notifications module picks it up, creates an inbox item, and optionally sends a push (capped at one a day, quiet hours respected).
NEEDS_REVIEW_The frontend pulls the artifact via an authenticated API call. The Hub re-renders with the new content. If the user was offline, the cache serves yesterday's view and the new artifact appears on reconnect.
NEEDS_REVIEW_Indexed for the queries each one answers.
NEEDS_REVIEW_Album entries. Indexes on userId, status, deletedAt. Soft-delete first; hard-delete of PII at 30 days.
NEEDS_REVIEW_AI-written chapters, encrypted body. Indexes on personId, userId, generatedAt. Aspect chips stored as a separate array for fast filtering.
NEEDS_REVIEW_User-written reflections, encrypted body. Indexes on userId, personId, createdAt. Text-indexed body for search. Per-entry 'private — do not feed to Luminara' flag.
NEEDS_REVIEW_Four-dimension scores per bond. Unique index on personId. Recomputed via service call after chapter or journal write.
NEEDS_REVIEW_Strict rule: events fire only after the database commit. Cross-module dependencies via Symbol injection tokens, never via forwardRef. No direct service-to-service imports between feature modules.
SoulwiseEvents.CHAPTER_COMPLETED — NEEDS_REVIEW_SoulwiseEvents.CHAPTER_COMPLETED — fired after a chapter is encrypted and persisted. Notifications-v2 listens; creates inbox item; optionally sends push.SoulwiseEvents.JOURNAL_CREATED — NEEDS_REVIEW_SoulwiseEvents.JOURNAL_CREATED — fired after a journal entry is encrypted and persisted. Resonance service listens; triggers recompute.SoulwiseEvents.PERSON_BIRTH_UPDATED — NEEDS_REVIEW_SoulwiseEvents.PERSON_BIRTH_UPDATED — fired after a person's birth-data changes. Synastry cache invalidates.SoulwiseEvents.PUSH_REQUESTED — NEEDS_REVIEW_SoulwiseEvents.PUSH_REQUESTED — per notifications-v2 contract; respects push budget and quiet hours.NEEDS_REVIEW_119 traceable requirements, zero gaps. Each requirement maps forward to a test case (UTP, ITP, STP, E2E) and backward to a user story. 20 user stories. 15 functional requirements. 12 non-functional categories. 8 global acceptance gates.
NEEDS_REVIEW_Chapter generation 30 seconds or better for 95% of requests, measured against BullMQ job duration distribution. API p99 GET latency 500 ms or better at 1,000 concurrent users, measured via k6 load test. Frontend TTI 3 seconds or better on simulated 4G, measured via Lighthouse CI.
NEEDS_REVIEW_AES-256 encryption at rest with platform-managed keys for journal and chapter bodies. TLS 1.2+ in transit; HTTP→HTTPS redirect. JWT access tokens with 1-hour lifetime, refresh tokens with 30-day lifetime, rotation on refresh. Soft-delete with 30-day window before hard-delete of PII.
NEEDS_REVIEW_prefers-reduced-motion globally respected — GSAP animations become opacity-only fades. VoiceOver and TalkBack labels on every interactive element. Manually verified on iOS and Android before each release.
NEEDS_REVIEW_Because the upstream spec rebuilds the feature, and rebuilding inside an existing module would either break the v1 experience or fork-then-merge later. A new module keeps v1 untouched, lets v2 prove out, and migrates cleanly when ready.
NEEDS_REVIEW_The existing My Zodiac AI backend is on MongoDB; switching would mean an infrastructure decision unrelated to this feature. The document model also fits chapters and journal entries well — nested, varying-length, encrypted-as-blob.
NEEDS_REVIEW_BullMQ runs on Redis, which is already in the stack for session and rate-limit. No new infrastructure. Built-in retry, timeout, and observability cover the chapter-generation needs without custom plumbing.
NEEDS_REVIEW_Internal repo. The numbers and contracts on this page paraphrase the upstream V-Model artifacts. Public-facing engineering blog posts on My Zodiac AI's blog cluster (tagged 'cosmic-story-v2') go deeper into specific parts of the build.
Mientras Soulwise abre sus olas, nuestra app principal de astrología ya está en tus manos.
El contenido astrológico es para la reflexión y el entretenimiento. Las funciones de Cosmic Story v2 descritas aquí están en desarrollo; la disponibilidad puede cambiar sin previo aviso.