diff options
| author | tv <tv@krebsco.de> | 2026-11-29 04:34:59 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-29 04:34:59 +0000 |
| commit | a363c9958788dc648828410126f0f93c0c9bee5f (patch) | |
| tree | 29b61cd65b9992ba2b3b7729ecceafce8a30d196 /docs/document.md | |
| parent | 2a475153b715c954935ae46d3773ffbf3d007f03 (diff) | |
wire: version 53, what is the document's as bytes, and the kind in handshakes
Spoken beside 52 (OLDEST), so a swarm upgrades node by node: a node
writes each peer the newest version both speak.
From 53 on (wire::KINDS, wire::kinds), what is a document's kind's goes
as bytes the wire carries and doesn't read: a SYNC's body, with whether
it is taken as delivered, and what vouches for what it carries; where a
STATUS says its sender stands; what a BLOB request asks for in bulk; a
BLOB is of a unit or of what is offered in bulk, by their names.
Automerge's bytes are what 52 carries in the messages' own fields.
HELLO and HELLO_REPLY say the kind of the sender's document
(document::KIND, automerge) from 53 on; one in 52 says none and is of
that kind. A peer whose document is of another kind is refused in the
handshake, saying so.
The bytes of 52 stay as golden_bytes has them; golden_bytes_of_kinds has
those of 53. scripts/wire-check v0.0.1: its nodes and this tree's talk.
Diffstat (limited to 'docs/document.md')
| -rw-r--r-- | docs/document.md | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/docs/document.md b/docs/document.md index 77fa0bd..addc396 100644 --- a/docs/document.md +++ b/docs/document.md @@ -4,12 +4,14 @@ A design, built stage by stage ([Stages](#stages), below). So far: what is writt the node as it is; and of the second stage, what was the engine's in other modules on the engine's side (`document::own`, `dropping`, `screen`), the rules judging a unit at the state its writer saw (`access::rules::judge_seen`), values read and written -through a view any kind gives (`document::view`, `AppState::mutate_doc`), and what goes -to a peer next and what is made of what it sent on the document's side, as the wire -carries it now (`document::passing`). The node's document is an Automerge document, and -that is all it can be; this says what the rest of the node asks of it, which of that is -Automerge's shape and which is continuum's, and where the seam goes behind which a -swarm's document may be of another kind (a *kind* of document, a kind for short). +through a view any kind gives (`document::view`, `AppState::mutate_doc`), what goes to a +peer next and what is made of what it sent on the document's side +(`document::passing`), and a wire version in which what is a kind's is bytes, with the +kind said in handshakes (`transport::wire`, 53). The node's document is an Automerge +document, and that is all it can be; this says what the rest of the node asks of it, +which of that is Automerge's shape and which is continuum's, and where the seam goes +behind which a swarm's document may be of another kind (a *kind* of document, a kind for +short). Why: every write to an Automerge document is a change kept forever, and what Automerge does grows with their number, so a swarm takes no frequent writing; only a remake, which @@ -243,7 +245,10 @@ named where nodes meet, and nodes of different kinds refuse each other saying so ## Passing on -Not built: how a document of any kind is passed on, and what the wire carries of it. +How a document of any kind is passed on, and what the wire carries of it. Built: the +node asking Automerge's side for it (`document::passing`), and the wire version below. +Not built: the names above the seam as a kind's own in the node's memory, where a stamp, +a message's body and an offer in bulk are still Automerge's types. ### Whose it is @@ -292,25 +297,26 @@ rules (`access::rules::judge_seen`). ### On the wire -A wire version beside the one spoken now, in which what is a kind's is bytes: +Wire version 53, beside 52, in which what is a kind's is bytes (`transport::wire`, +`kinds`): -| Message | Now | Then | +| Message | In 52 | In 53 | |---|---|---| | SYNC | an Automerge sync message, or changes with heads, or a delta's heads; signatures of changes; `delivered` | the kind's bytes; what vouches, the kind's bytes | | STATUS | heads, or a digest and some of them | a stamp, the kind's bytes, no more than a keepalive may carry | | BLOB | a change by its hash, a delta by its heads, content by its hash | a unit by its name, something offered in bulk by its name with what the kind says of it, content by its hash | -| REFUSALS | changes by their hashes | units by their names | -| HELLO | the root's hash | the same, and the kind | +| REFUSALS | changes by their hashes | units by their names: the same bytes | +| HELLO | the root's hash | the same, and the kind (`document::KIND`) | What stays as it is: the epoch in every message, `ready`, the writer a push is along whose tree, when a message was sent, PRUNE and GRAFT, and everything that is no document's. -Automerge's bytes are what the version spoken now carries, so a node speaks both to its -peers as each can (`transport::wire`, versions side by side): a swarm of Automerge -documents upgrades node by node. A node that speaks the older version alone is of that -kind, and one of another kind tells it so, by the release that knows it, and syncs -nothing. +Automerge's bytes are what 52 carries in its messages' own fields, so a node speaks both +to its peers as each can (versions side by side): a swarm of Automerge documents +upgrades node by node. A node that speaks 52 alone says no kind, and is of the kind +there was then; nodes of different kinds refuse each other in the handshake, saying so, +and sync nothing. ### As merged state without a history would give it @@ -336,7 +342,8 @@ To see that what is asked isn't Automerge's in other words: a document or a transaction take a view to read or to write; passing on is asked of a kind ([Passing on](#passing-on)), first in the node, then on the wire; remakes become something a kind can do. Each step leaves the tests as they are. -3. **The kind named** where nodes meet, with one kind to name. +3. **The kind named** where nodes meet, with one kind to name: built, with the wire + version (`HelloRequest::kind`). 4. **Merged state without a history**, as a second kind, with what is written often as its test. 5. **A WireGuard mesh** as its first use: each node's key and where it is reached, |
