Publish cassette operations instead of counts #46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/cassette-ops-publisher"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 3 operator side: the dashboard records cassette operations instead of writing counts.
The operator can no longer set a count, because there is no longer an endpoint that accepts one. POST
.../cassettes/opsrecords a refill, an empty, a recount or a set_denomination and publishes the machine's recent window; GET.../cassettes/opslists them withacked_atso the dashboard shows each as applied or pending. The old publish endpoint,update_cassette_configandUpsertCassetteConfigDataare gone.Why: both sides used to write the same value over a transport that never tells a writer it lost. A dashboard form loaded before a dispense discarded that dispense on publish and nothing could detect it. Confirmed live on sintra on 2026-09-22.
Also here:
cassette_ops, the append-only op log. The id is the idempotency key the machine dedups on.counts_uncertain_since. The machine has been publishing it since v1 and we were parsing it into a field nobody read, which defeats the point: it exists to tell a human to open the bay and recount.seqand uses it to break a same-second tie in the ordering gate.created_atis one-second granular, and a dispense plus the publish after it share a second routinely.The op is recorded before the publish and is not rolled back if the publish fails. Notes went into a bay whether or not a relay was reachable. Each publish carries a window rather than just the newest op, so one that missed its own publish rides out with the next.
Deploy this before merging aiolabs/bitspire#106 (the machine consumer). Strict cutover, no compatibility code.
264 tests pass. Needs an LNbits restart on ariege plus a catalog release.
Design: aiolabs/bitspire
docs/adr/004-cassette-state-synchronization.md.