Summary
Add the new Operator and Architect subscription plans to the mobile app so users can purchase them, and implement chat message limits with backend enforcement and mobile paywall.
Acceptance Criteria
1. Mobile plans sheet shows 3-tier display (Neo / Operator / Architect)
- Plans sheet displays all 3 tiers as separate selectable cards
- Monthly/Yearly billing period toggle at the top
- Each tier card shows: plan name, subtitle (e.g. "2000 questions per month"), price, badges (Popular, Current, Ends on date)
- Users can select a tier and billing period, then tap Upgrade to purchase
2. Chat message limits enforced
- Free users: 30 messages/month. When hit, backend rejects (HTTP 402) and mobile shows paywall
- Neo users: 2000 messages/month. When hit, show paywall to upgrade to Operator/Architect
- Operator users: 500 messages/month
- Architect users: $400/month compute budget cap
- Mobile pre-checks quota via
GET /v1/users/me/usage-quota before sending each message
- Paywall bottom sheet shows usage info + "Upgrade Plan" button leading to plans sheet
3. Backend changes
- Update
NEO_CHAT_QUESTIONS_PER_MONTH default from 200 to 2000
- Add
plan_id, subtitle, eyebrow fields to PricingOption response so mobile can group plans by tier
Technical Notes
- Backend chat enforcement already exists (
enforce_chat_quota in utils/subscription.py) behind CHAT_CAP_ENFORCEMENT_ENABLED kill-switch
- Backend returns HTTP 402 with structured JSON when quota exceeded
- Mobile needs to handle both proactive quota check and 402 fallback
- Version gating:
NEW_PLANS_MIN_MOBILE_VERSION already set to 1.0.530, current build is 1.0.532
Files affected
backend/utils/subscription.py — Neo cap update
backend/routers/payment.py — PricingOption model update
app/lib/models/chat_quota.dart — New model
app/lib/backend/http/api/users.dart — New API call
app/lib/providers/message_provider.dart — Quota enforcement
app/lib/pages/chat/page.dart — Paywall trigger
app/lib/pages/chat/widgets/chat_quota_paywall.dart — New paywall widget
app/lib/pages/settings/widgets/plans_sheet.dart — 3-tier display
Summary
Add the new Operator and Architect subscription plans to the mobile app so users can purchase them, and implement chat message limits with backend enforcement and mobile paywall.
Acceptance Criteria
1. Mobile plans sheet shows 3-tier display (Neo / Operator / Architect)
2. Chat message limits enforced
GET /v1/users/me/usage-quotabefore sending each message3. Backend changes
NEO_CHAT_QUESTIONS_PER_MONTHdefault from 200 to 2000plan_id,subtitle,eyebrowfields toPricingOptionresponse so mobile can group plans by tierTechnical Notes
enforce_chat_quotainutils/subscription.py) behindCHAT_CAP_ENFORCEMENT_ENABLEDkill-switchNEW_PLANS_MIN_MOBILE_VERSIONalready set to1.0.530, current build is1.0.532Files affected
backend/utils/subscription.py— Neo cap updatebackend/routers/payment.py— PricingOption model updateapp/lib/models/chat_quota.dart— New modelapp/lib/backend/http/api/users.dart— New API callapp/lib/providers/message_provider.dart— Quota enforcementapp/lib/pages/chat/page.dart— Paywall triggerapp/lib/pages/chat/widgets/chat_quota_paywall.dart— New paywall widgetapp/lib/pages/settings/widgets/plans_sheet.dart— 3-tier display