Implement conversation logging feature and privacy opt-out enhancements#79
Implement conversation logging feature and privacy opt-out enhancements#79ajay-bhargava merged 23 commits intomainfrom
Conversation
…leanup Backend: - Add paid opt-out of training data (schema, enforcement in conversationLogs, Polar webhooks) - Add email thread metering: 10 free/month, auto-paywall email on 11th via preflightOutboundEmail - Integrate preflight checks into emailReply.ts and notes.ts - Add Polar webhook handlers for subscription lifecycle (create/update/cancel) - Auto-populate email from mentraUserId on user creation - Add backfillEmailsFromMentraId internal mutation for existing users - New email templates: OptOutCheckout, EmailThreadPaywall Frontend: - Settings: add Training Data card (sends opt-out email, no in-app checkout) - Remove all payment/billing/usage language from web app - Remove Email Threads card entirely (entitlement handled via email) - Type safety fixes across ChatPage, FollowupsPage, MemoryPage, QueuePage Screenshots: - Add iPhone 15 mobile screenshots for Home, Memory, Follow-ups, Queue, Settings Amp-Thread-ID: https://ampcode.com/threads/T-019c9d33-f47d-73fa-b739-2873a25a4d6f Co-authored-by: Amp <amp@ampcode.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7faf9d971e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .order("desc") | ||
| .first(); |
There was a problem hiding this comment.
Correlate response updates with a unique log record
updateResponse finds the row to patch by sessionId + userId + transcript and then takes the newest match; if the same utterance text is logged twice in one session (for example, the user repeats a command before the first flow finishes), the first flow can update the second row and leave the first row without its response. That silently corrupts transcript/response pairing in training data, so the update path should target a unique log identifier returned from logConversation.
Useful? React with 👍 / 👎.
| handler: async (ctx, args) => { | ||
| return await ctx.db | ||
| .query("conversationLogs") | ||
| .withIndex("by_session", (q) => q.eq("sessionId", args.sessionId)) | ||
| .order("desc") |
There was a problem hiding this comment.
Enforce ownership checks before returning conversation logs
This query returns raw transcripts by sessionId without any auth or user scoping in the handler, which means callers who can invoke public Convex queries can read conversation logs for sessions that are not theirs. Since this commit introduces sensitive ML-training transcripts, this should be restricted to internal/admin usage or validated against the caller’s identity before returning data.
Useful? React with 👍 / 👎.
Amp-Thread-ID: https://ampcode.com/threads/T-019c9fa8-bdc3-769b-94db-0e2af8ecf11a Co-authored-by: Amp <amp@ampcode.com>
No description provided.