Skip to content

Implement conversation logging feature and privacy opt-out enhancements#79

Merged
ajay-bhargava merged 23 commits intomainfrom
staging
Feb 27, 2026
Merged

Implement conversation logging feature and privacy opt-out enhancements#79
ajay-bhargava merged 23 commits intomainfrom
staging

Conversation

@ajay-bhargava
Copy link
Copy Markdown
Contributor

No description provided.

ajay-bhargava and others added 22 commits January 19, 2026 16:03
…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>
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clairvoyant Ready Ready Preview, Comment Feb 27, 2026 3:14pm

Request Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +71 to +72
.order("desc")
.first();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +32 to +36
handler: async (ctx, args) => {
return await ctx.db
.query("conversationLogs")
.withIndex("by_session", (q) => q.eq("sessionId", args.sessionId))
.order("desc")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@ajay-bhargava ajay-bhargava merged commit 6c4d290 into main Feb 27, 2026
6 checks passed
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