Lamport logical clocks, field-level auto-merge, and non-destructive conflict preservation across offline household devices in Rust & WebAssembly.
In a real household, two devices rarely agree on wall-clock time to the millisecond—and one of them is frequently offline in a basement, grocery aisle, or airplane seat. Relying on naive server timestamps risks silently overwriting a spouse's grocery update or losing a note written offline.
Instead, every operation in this simulator carries a monotonic Lamport logical clock and a replica identifier . Whenever a replica generates a local operation, it increments its clock:
Whenever a replica receives a remote operation with timestamp , it advances its clock past both histories:
After reconciliation, both devices compute an FNV-1a 64-bit fingerprint over their canonical block state. Matching fingerprints confirm exact byte-for-byte convergence without a central coordinator.
To inspect Homeberry's production end-to-end encrypted yrs CRDT and zero-knowledge relay implementation in Rust, see homeberry-sync.