# kcode-credits
`kcode-credits` owns Kennedy's independent SQLite-backed gamification balances.
Authenticated immutable user identifiers are supplied by the caller; this
library does not authenticate users.
## API
- `Credits::open(path)` opens or creates the database, enables WAL and a
15-second busy timeout, and returns a cloneable handle with one short writer
lane. The containing directory must already exist.
- `Credits::balance(user_id)` returns `Balance { amount, revision }`. An unseen
user has amount zero. `revision` is the database-wide monotonic revision used
for inexpensive UI change detection.
- `Credits::award(user_id, amount)` atomically adds a nonnegative `u64` amount
and returns the resulting `Balance`. Zero is a read-only no-op. Empty user
identifiers and values or totals beyond SQLite's signed-integer range fail.
Each balance read uses its own short connection. The capability deliberately
has no ledger, history, spending, transfer, idempotency, or outbox API.