fix(quotas): unifier le décompte IA (BYOK, rollback) et combler les fuites
All checks were successful
CI / Lint, Unit Tests & Build (push) Successful in 6m55s
CI / Deploy production (on server) (push) Successful in 36s

Centralise la réserve via ai-quota, corrige admin unavailable (-1), brancher les routes sans quota et le host-pays brainstorm, avec usage-meter élargi, noms de clusters, MCP et ajustements dashboard/insights.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Antigravity
2026-07-15 20:42:25 +00:00
parent 30da592ba2
commit 4fe31ebc99
75 changed files with 2949 additions and 785 deletions

View File

@@ -0,0 +1,19 @@
import { describe, it, expect } from 'vitest';
import {
ENTITLEMENT_UNAVAILABLE,
FALLBACK_TIER_LIMITS,
} from '@/lib/plan-entitlements';
describe('plan-entitlements unavailable sentinel', () => {
it('ENTITLEMENT_UNAVAILABLE should be -1', () => {
expect(ENTITLEMENT_UNAVAILABLE).toBe(-1);
});
it('fallback limits should not use unavailable sentinel', () => {
for (const tier of Object.keys(FALLBACK_TIER_LIMITS)) {
for (const [, limit] of Object.entries(FALLBACK_TIER_LIMITS[tier as keyof typeof FALLBACK_TIER_LIMITS])) {
expect(limit).not.toBe(ENTITLEMENT_UNAVAILABLE);
}
}
});
});