diff options
| author | tv <tv@krebsco.de> | 2026-11-13 04:49:38 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-13 04:49:38 +0000 |
| commit | 369cfb6a110ed384f18792ccd13a50f7cf27559a (patch) | |
| tree | 3b792e3cbd40967cdf2ed011196d44ee6d16af05 /docs/access.md | |
| parent | 519e0a1019b9f74ce8a12773a47d613a05aecdf8 (diff) | |
screen: take only the operations transactions write
Screening asked what an operation isn't: a deletion replacing nothing, a
value put at a list's head without inserting, a mark ended but right after
its begin. Others pass that Automerge's transactions never write, and
Automerge takes them and breaks: an element written over naming as replaced
the element inserted after it (an inserted element's key is the element it
follows, its place is itself), an insert replacing something, a deletion or
an increment inserted, an increment at a list's head, a mark ended ahead of
its begin or at the head, a mark in a list. Giving such a change back
panics or gives another change under its hash, and the save doesn't load.
Each operation is now asked to be one transactions write
(`document::changes::unwritten`): inserted, a value, an object or a mark's
begin or end into a list or a text, replacing nothing; at a list's element,
never its head, without inserting, replacing what is at that element; at a
map's key, never inserted, a deletion or an increment replacing something;
a mark's begin with its end as the next operation, both inserted. A value
replaced at a list's element is the element itself or written at it, not an
element inserted after it. Marks are only in a text, and a mark's end is at
its begin or at an element after the begin's: their places follow from the
elements each is inserted after, back to the text's head, as the change's
history holds them.
The document the tests write now has counters in a list and a map, an
element written over, and marks over a span, the whole text, none of it, and
across what was deleted and inserted since; and each case above is a test.
Diffstat (limited to 'docs/access.md')
| -rw-r--r-- | docs/access.md | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/docs/access.md b/docs/access.md index 976197e..2b5f54c 100644 --- a/docs/access.md +++ b/docs/access.md @@ -314,10 +314,14 @@ wouldn't have written: bytes that aren't Automerge's encoding of the change; a f operation not numbered one after the highest of its dependencies; a change that isn't its actor's first and doesn't build on the one before; an operation naming one that wasn't made in the change's own history, or that isn't what it is named as (the -object written into, the element of that list, a value replaced at that place); and -anything Automerge's own transactions never write (a deletion replacing nothing, a -value put at a list's head without being inserted, a mark ended but right after its -begin). Automerge applies some of those, and then panics, saves a document that doesn't +object written into, the element of that list, a value replaced at that place); and an +operation other than those Automerge's own transactions write. Those insert a value, an +object or a mark's begin or end into a list or a text, replacing nothing; write at a +list's element, never its head, without inserting, replacing what is at that element +(the element itself, or what was written at it); write at a map's key, never inserting, +a deletion or an increment replacing something; and mark only in a text, the end +inserted right after the begin, at the begin or at an element after the one the begin +follows. Automerge applies some others, and then panics, saves a document that doesn't load, or holds another change than the one it was given. All of it is asked of the change and its history alone, so two nodes that hold a change's history come to the same, whatever else they hold: a change of the same batch refused after it passed |
