Sync / Editing server data

What each helper handles

  • ProductEdits.edited and ProductEdits.Edit: Schemas describing the durable Message payload and the stored per-cell edit entries.
  • ProductEdits.merge: Purely folds new changes over existing edits, keeping the latest edit per cell. Sending the operation to the server happens via Sync.fact in update.
  • ProductEdits.stamped: Runs exclusively inside the server journal at commit time. Clients leave at and by unset; the journal's validate rejects any client operation that tries to supply them.
  • RemoteEdits.reconcile: Purely aligns Remote's optimistic overlays with the current edits slice and returns the updated Model. Call it in afterUpdate rather than update so server and replica replay only touch the replicated slice.
  • settle and applyEdits: Runs apply for each committed change through a recovery intent. Because the journal's effect ledger and the SQL table may be separate stores, an intent can replay after a crash; applyEdits guards the update with revision <= at on the binding's fixed columns so replaying an older or identical sequence is safe.