Backend Proxy
Quota Management & Token Bucket Rate Limiting
In enterprise and public-sector collaborative deployments, public APIs often enforce strict rate limits and daily quota ceilings.
Slasher implements a resilient multi-tier architecture ensuring that documents never break even when upstream APIs experience outages or exhaust their quotas.
🧭 1. Provider Runtime State Machine
Every sovereign connector operates under a 5-state health machine:
📊Architecture Diagram
Loading diagram...
| State | Condition | Backend Behavior | Frontend / UI Impact |
|---|---|---|---|
🟢 HEALTHY | Quota $< 80%$, API operational | Direct search & suggest with 24h caching | Live green indicator (⚡ Live) |
🟡 DEGRADED | Quota $\ge 80%$, $< 100%$ | Serve cache on priority; reserve $20%$ quota for detail lookups | Subtle warning badge; priority cache lookup |
🟠 CACHED_ONLY | Circuit breaker open (HTTP 429 / 5xx) | Zero external network calls; serve verified cache & local index | 🕒 Cache Mode badge; no editor disruption |
🔴 QUOTA_EXHAUSTED | Daily quota $100%$ consumed | Return verified cached records with verifiedAt timestamp | Explanatory message; editing remains fluid |
🛡️ 2. Rate Limiting & Anti-Abuse Hierarchy
To prevent a single user or runaway automation from exhausting global public API quotas, Slasher enforces a 3-tier limit:
📊Architecture Diagram
Loading diagram...
📡 3. Telemetry & Health Endpoint
The backend exposes a real-time status endpoint for monitoring:
Code
Response Payload (200 OK):
Code
💡 4. Immutable Block Snapshots Guarantee
A fundamental rule of Slasher is lossless document persistence:
- When an entity is inserted into a BlockNote document, its full normalized snapshot (
title,excerpt,meta1..3,url,verifiedAt) is saved directly into the document AST. - If the remote ministerial API goes down years later, the document renders identically without breaking or showing empty boxes.
Last modified on