The laws a database keeps so that its rows can be dumped and replayed into another and be merged by the replaying alone, as typed code: which tables are the mergeable set (the version rows, whose primary key is the id and the sum with a conflict rule that ignores a second insert, and the blobs, whose primary key is the SHA-256), which are derived (views and caches made only from those rows, never dumped as a source) and which are local (the identity of the replica, whom it trusts, the epochs it holds, its caches: never in a dump and never written by an import); the procedure that makes a dump and replays it; the epoch that lets rows be collected without a replay of an old dump bringing them back; and the identity of a replica, which a copy of a database does not keep.
The tables a dump carries: the version rows (primary key id with sum, on conflict ignore, without a rowid) and the blobs (primary key sha, on conflict ignore). A row of them is immutable and an equal key is an equal row.
The tables made from the rows and nothing else: the heads, the names, the siblings and the vector. Views, or caches a rebuild makes again, and never dumped as a source.
The columns of the version table, in order: no autoincrement, no column unique but the key, nothing that depends on the order of an import. merged is the ids merged with, as a list of text.
The steps of taking a dump into a database, in order: make the schema first (a dump has none, and a full dump with its schema cannot be replayed twice), replay each dump inside one transaction in any order and as often as you like, and then verify, because a raw import passed through no check of ours.
The conflict rule of the primary key of a mergeable table: ignore the second row, so that replaying a dump twice, or two overlapping dumps, is replaying their union.
How trust is held where a raw import bypasses the application: a trigger before the insert refuses a row of a replica that is not in the trust table, and the verify step checks the rest (sums, ids, blobs, time), which a trigger cannot.
An epoch: a compaction of the rows against a roster of replicas that is known to be complete. A row whose number the horizon covers is dead unless the epoch retains its key, so that replaying an old dump cannot bring back what was collected.
The horizon of a roster: for each replica, the least number any replica of the roster holds of its rows. Every replica of the roster must have reported its vector: otherwise the roster is not known to be complete, and the refusal says who is missing.
The identity of a replica when its database is opened. Where the database holds one and the fingerprint is the one the host makes now, it is kept. Where the fingerprint is not (the file was copied, or restored from a backup into another place), the replica takes a new identity, so that two copies never make the same ids, and says which it was copied from. Nothing was stored: a new identity.