Two payment-correctness fixes:
1) Add-ons are now ONE-TIME. Previously the extra-project allowance was added
permanently to the monthly limit, so buying one add-on granted +1 project
EVERY month forever. Now the monthly tier quota resets monthly, and each
add-on credit is consumed only when creating a project beyond that quota
(settle_project_creation + consume_extra_project). check_limit/billing expose
a single can_create gate; the dashboard uses it instead of used>=limit.
2) The checkout fallback used to INSERT a free 'manual' active subscription (or
grant a free credit) whenever create_checkout_session raised. On a transient
Dodo error this silently gave users paid plans they never bought (e.g. a
phantom tier-2 Work Programme = 4 projects). Now, when Dodo is configured,
the failure returns 502 instead of granting anything; the mock path only
runs locally when no Dodo key exists.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feat: apply latest bug fixes and consolidate AI logic