Add unit coverage for the derivation-counter migration (mirrors the
production SQL against node:sqlite, like proofReservation.test.ts):
- setCounter is monotonic — raises, ignores a lower value, no-ops on equal
- bumpCounter advances relatively; non-positive delta is a no-op
- (mintUrl, keysetId) primary key isolates keysets and mints
- seedCounters is idempotent and never regresses an advanced counter;
a too-high seed is kept (conservative-safe)
- the folded counterUpdate persists the counter atomically with new proofs,
rolls back with them on a failed batch, and stays monotonic in-batch
Locks in the no-secret-reuse safety property of the migration.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>