aboutsummaryrefslogtreecommitdiffstats
path: root/src/remake/proposal.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-13 01:05:49 +0000
committertv <tv@krebsco.de>2026-11-13 01:05:49 +0000
commit6cb4d3fd8f5024c340bd9321a434c8579cce81e7 (patch)
treea7b79b83acafd0f37ed9c0ed3f683488e4e32d66 /src/remake/proposal.rs
parente519ade32a87811f287bb851e3e1dfcde6b064c9 (diff)
screen: what is asked of a change, asked of its own history
A change is refused before Automerge sees it unless it is one Automerge writes (`document::changes::Written`). Three things about that, each of which let a crafted change through or parted nodes: * An operation a change names (the object written into, a list's element, an operation replaced) must be made in the change's own history, or before in the change itself, not anywhere in the document. Else a node that holds the operation takes the change and one that doesn't yet refuses it for good: nodes part by the order changes reach them. * And it must be what it is named as: an object of the kind written into, an element of that list, an operation at the place written. A change that replaces an operation elsewhere marks an unrelated value gone, and Automerge then gives back another change under its hash and saves a document that doesn't load; one that writes into an operation that made no object makes it panic. * A change that isn't its actor's first must have the one before it among its dependencies, as a transaction puts it there. A gap in an actor's numbers makes Automerge panic. What the document holds at the changes this one builds on is read there where it can be (a map's key, an object held by a map's key); else the operation's own change is decoded and the history walked back to it, no further than the operation's counter. So operations on a list's elements cost a walk each. Decoding a change can panic too (an operation naming an actor its change doesn't list): caught, and the change refused as one whose bytes aren't Automerge's.
Diffstat (limited to 'src/remake/proposal.rs')
0 files changed, 0 insertions, 0 deletions