PostHog: fix signup_completed and add qr_picks_saved #241
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.50) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 403 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.359
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #241"
general
weight: 0.35
cursor[bot]
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Summary
Production showed 0
signup_completedevents vs 34login_completed(PostHog SQL, last 90 days). Root causes addressed:1. Auth events fired before
posthog.identifywhileperson_profilesisidentified_only, so sign-up captures were not reliably stored as identified funnel events.2. Email registration called
captureEventonly afterupdateProfile; a profile update failure created the Firebase user but skipped analytics entirely.3. Google registration relied solely on
getAdditionalUserInfo().isNewUser; when Firebase omits that flag, new accounts were recorded aslogin_completed.4. QR Nexus flow applied picks via
useApplyPendingPicks/ quick picker with no dedicated analytics event.Changes
frontend/src/analytics/authCompletion.js— identify-then-capture helpers; Google new-user metadata fallback; mutually exclusive signup vs login.frontend/src/analytics/qrPicksAnalytics.js+QR_PICKS_SAVED— fires after pending picks apply or signed-in quick save (pick_count,rows_written,utm_*,is_new_uservia short-lived session marker after signup).signup_completedandqr_picks_saved.How to verify (hosted)
1. Deploy Hosting (
Front end only deployworkflow ornpm run deploy:hostingwith PostHog env).2. Incognito: open
https://shardstash.web.app/getting-started?collect=pins&utm_source=qr&utm_campaign=nexus-2026, mark picks, sign up with Google or email.3. PostHog → Live events: expect
signup_completedonce (not paired withlogin_completedon that action), thenqr_picks_savedwithis_new_user: truewhen picks land within ~30 minutes of signup.4. Regression: existing user sign-in should emit
login_completedonly.Tests
npm run checkcd frontend && npm run test(1082 tests)authCompletion.test.js,qrPicksAnalytics.test.js; extendedAuthContext,useApplyPendingPicks,SocialLoginButtonstests.Deploy steps
Merge → run Front end only deploy on this branch (or main after merge). No Functions/Firestore changes.
<!-- CURSOR_AGENT_PR_BODY_END -->
<div><a href="https://cursor.com/agents/bc-f3de7933-67b5-53de-9224-f1dd399bbe2f?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-f3de7933-67b5-53de-9224-f1dd399bbe2f&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div>