01 Store events, not balances
The app records every action as an event and derives state by replaying them in order. Local storage is versioned so history can be migrated without losing it.
psychology Because it allows exactly what was needed: fix the rule, replay 3,536 real events, and confirm that 512 units shipped now deduct 512, with no box going negative. A balance-based record could not have proved anything.