Skip to content

P6: Add balance safety and token estimation fallback #25

@wauputr4

Description

@wauputr4

Goal

Prevent negative balances under concurrent usage and estimate tokens when upstream usage metadata is unavailable.

Acceptance Criteria

  • Wallet row is locked or otherwise protected during charge transaction.
  • Concurrent requests cannot push balance below zero.
  • Token estimation fallback is deterministic and marked estimated.
  • Tests cover insufficient credit and concurrent charge behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: meteringUsage events, token accounting, and credit chargesarea: walletCredit wallet, ledger, grants, and balance safetyenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions