Skip to content

Add opt-in live quota windows, budgets, pace projections, and alerts #43

Description

@ekalb81

Outcome

Show current subscription/API allowance windows, reset timing, balances, budget headroom, and projected run-out without conflating provider limits with transcript-derived token or API-equivalent cost.

Current state

  • Sessions may contain plan_type, credits_balance, and unlimited-plan metadata, but these are point-in-time transcript fields.
  • Odometer has no quota polling, reset countdowns, pace projection, configurable provider/project budgets, or usage alerts.

Scope

  • Define a provider-agnostic QuotaSnapshot with window kind, used/remaining values, unit, limit/reset times, provenance, fetch time, confidence, and stale/error state.
  • Implement quota sources as capabilities separate from transcript parsers. Reuse an existing provider session only with explicit consent; never copy passwords/tokens into Odometer config or logs.
  • Support multiple simultaneous windows (for example burst/session, weekly/monthly, credits) without coercing unlike units.
  • Add pace, reserve/deficit, projected exhaustion, and reset-aware budget calculations from one backend service.
  • Add per-provider and per-project soft budgets with local notifications and quiet/stale/offline behavior.
  • Surface quota status in the dashboard and existing tray. Hard enforcement and config hooks are explicitly deferred.

DRY boundary

  • One quota service feeds dashboard, tray, future widgets, CLI/statusline, and alerts.
  • Historical usage comes from the ledger; quota snapshots remain provenance-bearing external state.
  • Pricing/budget math consumes the shared pricing/plan authority.

Acceptance criteria

  • Provider outages, authentication expiry, rate limits, clock skew, sleep/resume, offline startup, and stale caches produce honest states rather than zero usage.
  • Credentials and response bodies never enter diagnostics, performance logs, exports, or fixtures.
  • Notifications are opt-in, deduplicated, reset-aware, and configurable per window.
  • Forecast math is deterministic and suppresses projections when evidence is insufficient.
  • Transcript-derived balances and live-provider snapshots can coexist and identify their source.

Dependency and ordering

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions