Remote / Declared writes

The mental model

One row version decides everything, and one statement writes it:

the guard reads the row at revision r, and decides its rules over it
                    |
                    v
update … set name = ?, stock = stock + ?, revision = revision + 1
       where id = ? and revision = r and <when> and <invariants>
                    |
     a row changed -+- none changed
          |                  |
   the row as written    classified: gone, moved on (Conflict),
                         does not hold `when` (Unmet), or would break
                         an invariant (Invalid)

On the client, what a pending write shows is the store plus the pending writes, recomputed whenever it is read:

shown = committed row + pending sets + pending amounts (added to what is under them)