@zimoun @cwebber @semitones brassica chat uses CRDTs (https://crdt.tech/) which are data structures designed such that all conflicts are resolved automatically and deterministically. they handle conflicts but not history rewrites. those are two separate issues.
exactly how conflicts are resolved depends on the app you are building. for brassica chat it's fairly simple and the "last write wins" strategy works fine for things like editing messages but a lot of the work in CRDT development is handling concurrent, conflicting operations.
in git, the set of commits is append-only and the commits are immutable. in other words, the commit graph is monotonic. the data inside a CRDT must also be monotonic. in contrast, refs (branches, etc.) are mutable and nonmonotonic. rewriting history is simply mutating a ref to point at a different commit. CRDTs cover the append-only, immutable log part but not the mutable pointer part. anything that is not a monotonic operation requires coordination. the general idea is that using CRDTs reduces the number of things that require coordination in your system so that more of the app works offline/during a net split.