Skip to content

feat(persona-quiz): add bragi-backed GraphQL mutations#3874

Merged
davidercruz merged 3 commits into
mainfrom
davidercruz/walla-walla
May 13, 2026
Merged

feat(persona-quiz): add bragi-backed GraphQL mutations#3874
davidercruz merged 3 commits into
mainfrom
davidercruz/walla-walla

Conversation

@davidercruz
Copy link
Copy Markdown
Contributor

Summary

  • Adds personaQuizNextQuestion GraphQL mutation that proxies bragi.NextPersonaQuizQuestion, pulling NMF candidate_topics from recswipe as steering signals on each turn
  • Adds personaQuizReveal GraphQL mutation that proxies bragi.PersonaQuizReveal, merges with recswipe recommendTags fillers, and filters the result through the canonical Keyword table so unknown slugs can't FK-violate downstream followTags inserts
  • Bragi mock client extended with both RPCs for local + test runs

The canonical-filter step is load-bearing: ContentPreferenceKeyword.keywordId is a @ManyToOne FK to Keyword, so a hallucinated tag from bragi would crash the addFiltersToFeed resolver when the user hits "Looks good" on the quiz reveal screen.

This depends on a schema-python (and @dailydotdev/schema) bump including the new bragi/pipelines.proto types (NextPersonaQuizQuestionRequest/Response, PersonaQuizRevealRequest/Response, etc.).

Test plan

  • pnpm install resolves cleanly after @dailydotdev/schema bump
  • pnpm lint passes
  • pnpm test __tests__/schema/onboarding.ts passes the 8 new persona-quiz specs (4 for personaQuizNextQuestion, 4 for personaQuizReveal)
  • Manual: with BRAGI_ORIGIN set, hit the new mutations end-to-end against a bragi instance carrying the matching schema rev — verify the structured question / reveal copy / filtered tag list shape
  • Manual: confirm hallucinated bragi tag (e.g. "definitely-not-a-keyword") does NOT appear in personaQuizReveal.includeTags

🤖 Generated with Claude Code

Adds two stateless mutations wrapping the new bragi PersonaQuiz pipelines:
- personaQuizNextQuestion proxies bragi.NextPersonaQuizQuestion, fetching
  NMF candidate_topics from recswipe for steering on each turn.
- personaQuizReveal proxies bragi.PersonaQuizReveal, merges with recswipe
  recommendTags fillers, and filters the result through the canonical
  Keyword table so unknown slugs can't FK-violate downstream followTags
  inserts.

Mocks added to the bragi client for local + test runs. Tests cover auth,
input validation, recswipe steering pass-through, isFinal propagation,
recswipe-failure resilience, the Keyword-table canonical filter, and the
targetCount cap.

Requires a schema-python bump including the new bragi proto definitions
before TypeScript types from @dailydotdev/schema resolve.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pulumi
Copy link
Copy Markdown

pulumi Bot commented May 13, 2026

🍹 The Update (preview) for dailydotdev/api/prod (at bdb6ded) was successful.

✨ Neo Explanation

Standard image rollout deploying the new persona quiz GraphQL mutations (`personaQuizNextQuestion` and `personaQuizReveal`) with paired DB and ClickHouse migration jobs. ✅ Low Risk

This is a routine code deployment rolling out two new GraphQL mutations (personaQuizNextQuestion and personaQuizReveal) along with a bump of @dailydotdev/schema from 0.3.7 to 0.3.8. All deployments and cron jobs are receiving the new container image tag (d562bcb4). The migration jobs are being recycled with the new commit hash in their names, which will run both the TypeORM DB migration and ClickHouse migration against the new build — this is the standard pattern for this stack.

🔵 Info — The personaQuizReveal resolver queries the Keyword table at runtime to filter tags before they can reach feedSettings.includeTags. No schema migration adding new tables is visible here, so this relies on the existing Keyword table being populated. If the Keyword table is sparse or a migration is expected to seed it, the reveal flow will silently return fewer tags than targetCount.

Resource Changes

    Name                                                       Type                           Operation
~   vpc-native-clean-stale-user-transactions-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-updated-sync-cron                  kubernetes:batch/v1:CronJob    update
+   vpc-native-api-clickhouse-migration-d562bcb4               kubernetes:batch/v1:Job        create
~   vpc-native-expire-super-agent-trial-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-materialize-monthly-best-post-archives-cron     kubernetes:batch/v1:CronJob    update
~   vpc-native-channel-digests-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-temporal-deployment                             kubernetes:apps/v1:Deployment  update
~   vpc-native-ws-deployment                                   kubernetes:apps/v1:Deployment  update
~   vpc-native-generic-referral-reminder-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-expired-better-auth-sessions-cron         kubernetes:batch/v1:CronJob    update
~   vpc-native-user-posts-analytics-refresh-cron               kubernetes:batch/v1:CronJob    update
~   vpc-native-daily-digest-cron                               kubernetes:batch/v1:CronJob    update
~   vpc-native-deployment                                      kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-gifted-plus-cron                          kubernetes:batch/v1:CronJob    update
~   vpc-native-sync-subscription-with-cio-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-private-deployment                              kubernetes:apps/v1:Deployment  update
~   vpc-native-rotate-daily-quests-cron                        kubernetes:batch/v1:CronJob    update
+   vpc-native-api-db-migration-d562bcb4                       kubernetes:batch/v1:Job        create
~   vpc-native-update-trending-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-update-source-public-threshold-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-channel-highlights-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-channel-highlights-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-bg-deployment                                   kubernetes:apps/v1:Deployment  update
~   vpc-native-squad-posts-analytics-refresh-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tags-str-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-hourly-notification-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-materialize-yearly-best-post-archives-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-history-day-clickhouse-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-generate-search-invites-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-users-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tag-materialized-views-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-update-achievement-rarity-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-history-clickhouse-cron  kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-clickhouse-cron          kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-opportunities-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-deployment                  kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-zombie-user-companies-cron                kubernetes:batch/v1:CronJob    update
-   vpc-native-api-db-migration-4f36baef                       kubernetes:batch/v1:Job        delete
-   vpc-native-api-clickhouse-migration-4f36baef               kubernetes:batch/v1:Job        delete
~   vpc-native-update-current-streak-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-cron                        kubernetes:batch/v1:CronJob    update
... and 11 other changes

davidercruz and others added 2 commits May 13, 2026 22:50
- escape backticks in personaQuizReveal docstring so the GraphQL
  schema template literal stays well-formed
- read recommended_tags from recswipe and map .tag (not recs.tags)
- bump @dailydotdev/schema to 0.3.8 for new persona-quiz proto
  types and Pipelines RPCs
- prettier auto-fixes in onboarding tests

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
recommendTagsMock was returning { tags: string[] }; the actual
RecommendTagsResponse is { recommended_tags: { tag, score }[] }.
Match the resolver code so the persona-quiz integration tests
exercise the real mapping path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@davidercruz davidercruz merged commit c2a350f into main May 13, 2026
10 checks passed
@davidercruz davidercruz deleted the davidercruz/walla-walla branch May 13, 2026 22:14
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.

1 participant