Read APIs
GET /api/overview
GET /api/spend
GET /api/agents
GET /api/transactions
GET /api/transactions/[id]/audit
GET /api/health
Write and actions
POST /api/budgets
POST /api/demo/run
POST /api/demo/reset
Purchase engine, one transaction, OCC retry
1
Verify the mandate chain
Ed25519 over canonical JSON: signatures, hash links, intent scope
2
Kill-switch, the agent must be active
3
Read the applicable budgets and every ancestor cap
4
Budget check, does the amount fit every cap
5
Claim the payment as single use (redeemed_payments key)
6
Decrement remaining_cents
the single row two racing purchases collide on
7
Write the transaction, two balanced ledger rows, the chain
8
COMMIT
on SQLSTATE 40001: roll back, re-read the balance, re-run
Any gate fails, the purchase is blocked and recorded with its reason.