Internal Documentation internal
TalkIDE internal documentation

What this context does

The platform-level layer that wraps every Anthropic call: the gateway that records spend, the fatigue / FUP machinery that decides whether the next turn is even allowed, the invite cascade that controls who can sign up, and the admin capacity console that gives Platform Operators a global emergency brake. It is the place the platform spends money and the place that decides when not to.

Scope boundary

  • Owns: AnthropicGatewayService, api_usage_ledger, fatigue state machine, Redis quota windows, invite tokens, capacity dashboard.
  • Does not own: the conversation lifecycle (UC-04), per-turn user experience around fatigue states (rendered by UC-04 FE using the fatigue envelope from UC-08002).

Main entities

api_usage_ledger (per-turn spend record), Redis rolling-window keys (5h + weekly per user), Invite (planned, UC-08003). Detailed schemas in each UC.

Use cases

UCStatusWhat it does
UC-08001ImplementedAnthropic Call Gateway — wraps MaraExecutor, persists api_usage_ledger per turn
UC-08002PlannedMara Fatigue & Quota Enforcement — Redis 5h+weekly windows, FRESH→ASLEEP state machine, model swap, FE fatigue envelope
UC-08003PlannedInvite System — founder-gated invite cascade, invite tokens (see ADR-020 Rozhodnutí 6)
UC-08004PlannedAdmin Capacity Console — global emergency brake, capacity dashboard, reconciliation log

Component diagram

{/* Image missing: UC-08 Mara Platform — Component View (../../assets/diagrams/uc08Components.svg) */}

Dependencies on other contexts

  • UC-04 Conversation — every Send Message routes through the Gateway; planned pre-turn check against UC-08002 quotas.
  • UC-01 User Management — Sign Up (planned) will require a valid invite token from UC-08003.
  • Mara Sidecar / CLI — the Gateway is the only sanctioned consumer of MaraExecutor.

Cross-cutting

  • All Mara spend goes through one gateway. Three previous UseCases were refactored to call the Gateway — that’s why per-user spend tracking is even possible.
  • FUP “grace finish” — quota is checked before a turn, never mid-turn. Once started, a turn finishes even if it crosses the limit (typically 5–10 % overshoot).
  • Founder-gated invites — TalkIDE alpha is a closed pool. Invite cascade is the only path in. See ADR-020.
  • Global emergency brake lives in UC-08004 — kill-switch independent of per-user FUP.

Was this page helpful?

Thanks for the feedback.