aboutsummaryrefslogtreecommitdiffstats
path: root/src/document/file.rs
Commit message (Collapse)AuthorAgeFilesLines
* document file: format version 3HEADmastertv30 hours1-5/+15
| | | | | | | | | | The document file's first line names its format; each record's first byte its kind. A version that doesn't know a kind refuses the file, as it does a format it doesn't know. With the Closed and Opened records, the format is continuum-document/3, so a version knowing only 2 refuses a file it can't read by its first line. Files of 2 are read as of 3: the same records, Closed and Opened where a version knowing them wrote them.
* document file: say which versions read a file, and the Opened recordtv30 hours1-4/+5
| | | | | | | | | | | The document file's format names itself in its first line (continuum-document/2) and each record's kind in its first byte. A record of a kind the reading version doesn't know makes the file unusable: the node doesn't start on it unless told to move it aside (--force badDocumentFile). lifecycle.md says so: a file one version wrote is read only by versions knowing every kind of record in it. The format's comment names the Opened record a node appends as it starts on the file, which undoes the clean stop's mark.
* document file: undo the clean stop's mark before deciding the actortv34 hours1-7/+13
| | | | | | | | | | | | | | At start, a node on a document file appends an Opened record before it writes anything, so that a Closed record before it no longer says the file holds every change of the actor it names. It does so now before deciding which actor to write as, and DocumentFile::open says whether it could: where the append fails (the disk full, permissions), the file still ends with Closed, and later appends likely fail too. A crash, or a clean stop whose last append failed (close then sees the file behind and writes no mark), would leave that Closed standing for a run the file never got. So with --keep-actor, the node writes on as the actor of before only where the file was marked as opened; else it writes as a fresh actor and warns.
* document file: a clean stop marked, and `--keep-actor` writes on as the same ↵tv3 days1-8/+86
| | | | | | | | | | | | | | | | | | | | | | actor A node writes as a fresh Automerge actor at each start, so no change number of an actor comes twice: one sent before a crash but not yet appended to the document file would otherwise be made again, differently. An epoch thus gathers a writer per start, and every transfer of its history carries a signature per writer. The document file now says when it holds everything the node wrote: * at a clean stop, after the last append, an empty `Closed` record, only where the file is up to the document's heads (ready, not rejoining); * as a node starts on the file, before anything is written, an empty `Opened` record, so a crash from then on leaves a file without the mark; * the header names the actor the node writes with (`current`). With `--keep-actor` (off by default; needs `--document-file`), a node starting on a file that ends with `Closed` writes on as that actor. A crash, a drop, a switch or a rejoin still starts a fresh one, so an epoch's writers come to one per node plus one per such event. lifecycle.md says so.
* signatures: with sync messagestv5 days1-21/+7
| | | | | | | Sync messages carry, for each actor's writes, the latest signature the sender checked; the receiver checks it once it holds the change. Auth plan M5.
* signatures: kept in the document filetv5 days1-34/+167
| | | | | | | A node's signatures are saved with its document (--document-file) and loaded with it. Auth plan M5.
* document: allow writes during rejointv12 days1-0/+5
|
* use Automerge as Document instead of AutoCommittv13 days1-6/+6
| | | | This allows a lot of operations to drop mut.
* tests write through document::testing helperstv13 days1-4/+3
|
* move all automerge references to documenttv13 days1-6/+3
|
* document: move knowledge about node to swarmtv13 days1-132/+130
|
* allow humand-friendly durations and sizes in CLItv2026-10-261-2/+2
|
* unify lock logictv2026-10-261-3/+2
|
* allow to persist documenttv2026-10-251-0/+362