| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Automerge writes no put of the value a key holds already, so the test can't have a node
write one: it judges such a change made by hand, a put of the event's bytes at its key,
at a history holding it.
|
| |
|
|
|
|
|
|
|
|
|
| |
Once a store moved to a checkpoint, a node reading it from the root could take what was
grown anew from the root since, by keys of versions long replaced: so its operator pins
the checkpoint (`--store-checkpoint`, by its ID), and the node reads its store from
there whenever it starts (`docs/store.md`, Pinned checkpoints). It finds it in its
document: at heads a proposal's version names, built from their history read from the
root, as any node builds the checkpoint it moves to (`Store::checkpoint_at`), the one
whose ID is pinned. Until the document holds it, the node holds no store, and says so
once.
|
| |
|
|
|
|
| |
`checkpoint_at` builds the checkpoint at heads the store took, its bytes and the events it
keeps, as the store does moving to a checkpoint, which now goes through it: so a node
can build one at heads it reads, to tell whether it is the one its operator pins.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
A node puts again, in changes of its own, every event its store holds that its
document lacks (`docs/store.md`, What the store takes from the document): one it took
from the document it left, at a drop or a rejoin, or from a change it refused, whose
events the store is offered as from anywhere (`Holding::look`, every few seconds, of the
changes screening keeps). It puts each after its dependencies, what the checkpoint keeps
first, then what the store took after it in the order taken, up to 1 MiB of events a
change, once a wait of its own has passed: random, between one and ten seconds after
the document first lacked them, so that not every node puts the same, and none another
node put meanwhile, as it looks again when it writes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A node of a swarm holding a store holds the store, read from its document
(`docs/store.md`, What the store takes from the document): `federation::held`. Whenever
the document changes, a worker reads the events it holds that the store wasn't offered
from it, under the document's lock, and offers them to the store without it, each taken
as from anywhere: once its dependencies are held, judged at its history. Another
document (a drop, a rejoin) is read as it comes, the store going on.
The node reads its store anew from its document whenever it starts, from the root, by
what is its own of it: the events it refused by what it took before, and those its
operator had it drop, which it keeps in a file (`--store-file`), written whenever that
changes, so that a store read anew in another order refuses what it refused before. A
file that doesn't read stops the node from starting; without one, a restart may take
what it refused.
|
| |
|
|
|
|
|
|
| |
A node refuses some events by what it took before (the federation: a second version
changing the one it reads), and others as its operator has it drop them; read anew, its
store would take events in another order, and so maybe the other one. `own` lists what
the store refused so, and `refusing` has a store starting out refuse them from the
start, whatever order the events then come in (`docs/store.md`, A node's own).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Behind the `federation` feature, two options:
* `--store-root PATH` starts a swarm holding a store, or goes on with one, from the
store's root, as bytes in the file, which the federation must take as a root. With no
document to start on, the node builds the genesis change from it, as every node given
the root does, and is ready at once; a document to start on must be of the root's
swarm.
* `--store-id ID` joins one through seeds by its ID, the root's SHA-256 in hex. An empty
document of the first epoch takes as its root only that store's genesis change, built
again from the root it holds (`document::events::is_genesis`), whatever peers name:
the root pin doesn't wait for seeds, nor is disputed.
Either names the swarm the node joins, which a state file must remember too, and can't
be combined with the other, nor with what makes a new swarm's first change (`--genesis`,
`--bootstrap-users`, `--bootstrap-keys`, `--bootstrap-policy`, `--remake`,
`--genesis-root`). The root is read as a file of its own kind (`store`), counted among
the node's files.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Every node judges a change of a swarm holding a store by what it writes, at its history
(`docs/store.md`, What a change writes), in place of rules by path: `access::holding`.
It writes events, each at `_continuum/events/<ID>` the bytes whose SHA-256 that is, no
larger than the fold allows (the federation's 256 KiB), at a key held nowhere at the
change's history; and its node's entry, with the member list's map where there is none.
Everything else is refused, as closed: values outside `_continuum`, the policy, the
swarm's ID, users, bans, the topology, remakes and their acks. Nothing deletes or
replaces an event. A change names its node; the genesis change's writer names none, so
no change under it is taken but the genesis change.
In a swarm not holding a store, a change writing a policy naming one is refused: a swarm
holds a store from its genesis change, or not at all.
The inspector tells a put of bytes apart (`Action::PutBytes`), with the bytes, for the
events' check. All of it behind the `federation` feature.
|
| |
|
|
|
|
|
|
|
|
|
| |
`{"version": 2, "store": "<fold>"}` at the policy's place is a swarm holding a store of
that fold (`docs/store.md`, What the document holds). Behind the `federation` feature, a
node reads it as `Policy::Store` where the fold is one it has (`federation`) and nothing
else is written there: changes judged, and signed, as required; not strict. Its `store`
reads so only where it is a string, as `values` of a strict policy. A swarm holds a store
from its genesis change only, so `--bootstrap-policy` takes none.
Without the feature, a policy of version 2 stays one the node doesn't know.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A swarm holding a store starts from its genesis change, which every node builds from the
store's root alike, so that one root makes one swarm (`docs/store.md`, What the document
holds). `document::events` builds it: it writes the policy naming the fold, the swarm's
ID (the root's) and the root at its ID, as bytes, each making the maps on its way, under
the writer made of the root ID's first 16 bytes, at time 0, without a message.
`is_genesis` tells such a change by building it again from the root it holds; `started`
is a document holding it, written to under a writer of its own; `ids` and `bytes` read
the events a document holds at `_continuum/events`. All of it behind the `federation`
feature.
|
| |
|
|
|
|
| |
A swarm holding a store names its fold in its policy, `{"version": 2, "store":
"<fold>"}`: the fold's name is a constant of the fold, `federation` for the federation and
`test` for the fold made for the store's tests.
|
| |
|
|
|
|
|
|
|
|
|
| |
Vectors (`docs/federation-tests.md`, Fixed bytes) for a write and its signature and ID,
the first version of two parties and its hash, the root it makes and its ID, a version
event, an event whose value holds names that UTF-16 units sort otherwise than bytes, and
events at federation 1's sizes and just past them: 256 KiB, 32 segments of 255 bytes,
64 nodes, integers to 2⁵³. Each value was computed apart from this code, by a script of
its own: JCS by hand, Ed25519 by another library, and the signature's blob as OpenSSH's
`PROTOCOL.sshsig` describes it, as `ssh-keygen -Y sign` makes it. Checking one against
`ssh-keygen` itself is left to whoever has it at hand.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Three to five parties write in their namespaces, change their key sets and node lists,
propose versions and checkpoints on what they last caught up with, vote, and write the
versions that pass; honest ones back one proposal on a version, an adversary votes as it
likes and signs as another party with its own key, or where it may not write. Over such
histories:
* the store judges every event, and reads, as the model does, offered the same events in
the same order, with an adversary and without;
* what builds on a refused event is refused;
* honest parties read the same whatever order the events come in, checkpoints and all;
* after a checkpoint, what the store took the model takes, reading the whole history but
for what the store refused as not above it, and the two read the same; the version
naming the checkpoint is taken;
* every version a store takes was backed by two thirds of the parties of the version it
changes, in its history;
* without a party voting twice, no two versions change one.
A failing history is cut down and printed.
|
| |
|
|
|
|
|
|
|
|
|
| |
The model (`docs/federation-tests.md`, The harness) reads the federation as
`docs/federation.md` says, as plainly as it can: every event judged at its history read
anew from the root, the version current there the highest-numbered written one, keys,
key sets, node lists, votes, passing and dead, version events and the heads a version
may name each worked out from that history alone; a node's own, the first of two
versions changing one; and what counts read from everything taken. It keeps nothing but
which events it took, and makes no checkpoint: slow and short, it is what the fold is
checked against. A test takes it through a version passing, offered last event first.
|
| |
|
|
|
|
| |
Two of the strings `json_written_otherwise_is_none` takes for none, an escaped U+2028
and an escaped `A`, stood in the file as the characters themselves, which JCS writes as
they are: the test took them for none, and they read. They are built as escapes now.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each row of `docs/federation.md`'s attacks marked unit that the fold and the store in
memory answer has its test, named by its row (`federation_attack_12`), with events made
for it by the harness: keys that aren't their party's, bytes that are none, events of
another federation or a fork, writes where a party held or holds no place, key sets
and keys stolen or dropped, votes cast twice, at once, split, or at a history from
before, versions that are none or written again late, two versions changing one in
every order, forks and roots, checkpoints, events not above their heads, and heads a
version may not name.
`every_row_marked_unit_has_its_test` reads the table and this file, and checks that
every row marked unit has its test, or waits for a later stage (what a node, a party's
client or a tool does, and what a node tells of a fork), and that no test names a row
that isn't there.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`Federation` is the store's fold for `docs/federation.md`. The state judging reads is
the state of an event's history, which the store builds from the checkpoint and that
history alone; so the version current there is the state's, the highest-numbered one
written, and a history holding two versions of one number is refused.
* A signed event's party is a party of the version current at its history. A write is
signed by a key among its party's (those of its key set that counts, else those its
version names) where a rule gives its party the place; a key set, node list,
proposal or vote by a key its version names.
* A vote is on the version current at its history, for a proposal proposed on it; a
`true` only where every other proposal its party backs on that version is dead.
Passing and dead go by the parties voting each way, a party with both counting for
both.
* A version event writes a proposal on the version current at its history, passed
there, which is a version changing that one; one naming a checkpoint names heads
after the current checkpoint at which it is current too, none in another's history,
the version event above them. A node keeps a version event only where it changes the
version it reads, or writes one it took.
* What counts is read by the current version: of each party's writes at a place it may
write, signed by a key among its party's, and of its key sets and node lists written
under a version at least their `since`, the latest, then the lowest ID. A checkpoint
keeps what counts at its heads and the proposals and votes on the version current
there; a fork's root what counts at its heads by its version; the members are the
nodes each party's node list names.
Tests take a federation through writes, a key set, a proposal passing, one yes at a
time, two versions changing one, a checkpoint and a node starting from it, and a fork.
Events are read with their signature checked once, where they are judged.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
`Event::read` reads an event and says what makes one none (`docs/federation.md`,
Events): bytes that aren't the JCS of the JSON they read as, larger than 256 KiB, with
no dependency or more than 64, not ascending, or a field missing or more; and of a
signed event, a party that is no party's name, a key or signature that doesn't read back
to itself or doesn't hold, a path, key set, node list or vote spelled otherwise. A
proposal is taken whatever it holds, named by its hash; a version event names a hash.
`Checkpoint` reads and writes `{"at", "keeps", "version"}`, a root among them, which is
no event.
The tests' harness (`docs/federation-tests.md`, The harness) makes parties with keys
from seeds, signs each kind of event as the design says, and spells versions out.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`Version::read` reads a version by itself, and says what makes one none
(`docs/federation.md`, The policy): a field missing or more but for `checkpoint`,
another federation, a number and `changes` that don't go together, keys and node lists
not of the same parties, a party's name, its keys (one to 16, spelled as keys, none twice
in the version) and its node list (up to 64 node IDs, none twice), checkpoint heads, and
rules (a literal first segment and not `_continuum`, `{party}` once at most, `**` last
only, a writer that is a party of it, `"{party}"` where the path holds `{party}`, or
`false`; a path as a write's may be). `changes_validly` asks whether it changes another:
one past its number, its hash, and each `since` its own number or the other's with the
same keys, or node list. `writer` gives who writes at a path, by the first rule that
matches; `only_moves_on` whether it changes nothing but its number, what it changes and
its checkpoint.
|
| |
|
|
|
|
|
|
|
|
|
| |
A key is `ssh-ed25519`, one space, and its base64, padded and canonical, with no
comment, its 32 bytes an Ed25519 public key; a node ID is spelled as continuum spells
it, its key one too; and a signature is the SSHSIG blob of version 1 for the namespace
`continuum-federation`, hashed with `sha512`, its reserved field empty, its key the
event's, in base64, padded and canonical, unarmored, checked by continuum's strict
check (`access::sshsig::verify_blob`) and read back to what `ssh-keygen` writes around
it. `keys::sign` makes one, for clients and tests. Tests show each spelled otherwise
taken for none.
|
| |
|
|
|
|
|
|
|
|
| |
An event is the JCS encoding (RFC 8785) of a JSON object, within the limits federation 1
sets (`docs/federation.md`, Events). `jcs::read` gives the JSON bytes are only where
they are what JCS writes of it: names sorted by their UTF-16 units and none twice, no
whitespace, strings escaped as ECMAScript escapes them; and, beyond JCS, numbers only
integers from −2⁵³ to 2⁵³, strings only whole Unicode characters, and objects and
arrays nested up to 32 deep. Tests show what reads back and what is none, the order of
names by UTF-16 units that byte order gets wrong, and the depth.
|
| |
|
|
|
|
|
| |
The test of forks expected an event the store it came from took after the fork's heads
to wait in the fork, but it builds on the put the fork's root keeps, which comes before
the root, its one head: the fork refuses it, not above its root, as it refuses an event
built on what a checkpoint keeps.
|
| |
|
|
|
|
|
|
| |
The document took any bytes that hash to their key, while the fold bounds events (the
federation: 256 KiB): one change of any size filled every node until the next remake.
How large an event may be is a question of the change alone, so the fold says it
(`Fold::LARGEST`), the document refuses a change putting a larger one, and the store
takes such bytes as none.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A merge, a fork at heads of several stores, named every party's keys anew, so that a
party wrote its key set again before anything a key of its set signed counted there;
and kept each side's values side by side, so that a value a party replaced on one side
came back where the other side's write had the lower ID. Letting the other side's
parties in, by a version or a fork naming them, who sign again what they keep as a
party's client signs again what a move refused, does the same with nothing new.
So a fork is at heads of one store: the fold makes its root from that store's state,
and the store from its own heads (`Store::fork`). Merges' rows go, those after them
move up, and Roads not taken says why, with merging in place.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two to four writers, each knowing what it wrote and what was written when it last caught
up with the others, write the test fold's events on one or two events they know. Eras
and cuts are numbered by their history, each number written once, or, for some
properties, as often as it comes. A store offered them is checked against the whole
history, read from the root with nothing forgotten:
* it holds the same whatever order the events come in: every order putting each after
what it builds on, for up to six events; some shuffled beyond; and backwards, where
every event waits until the first comes;
* it judges every event as the whole history does, the store's own refusals aside;
* what builds on a refused event is refused;
* what it took is above its checkpoint's heads, the cut naming the checkpoint among it,
and it reads as its checkpoint and what it took, and as its whole history;
* a node starting from its checkpoint holds what it holds.
A failing history is cut down, events taken out with what builds on them for as long as
it still fails, and printed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A cut names heads above those the latest cut of its history names, and holding that cut,
or, where its history holds none after the checkpoint the state starts from, heads after
that checkpoint or its own; as federation.md has a version name heads after the
checkpoint current at its history, at which that one is current too. It judged them by
the checkpoint the store holds, which isn't the one current at the history of a cut
taken in the same offer as the cut before it, before the store moves. A cut is above its
heads as store.md says, each of its dependencies one of them or above them, so that
moving to them refuses none of what named them.
Of a checkpoint's heads, whose history a state starting from it doesn't hold, it takes
none as built on another, nor on what the checkpoint keeps: starting from a checkpoint
at two heads, one of them kept, it took the other as built on it, and refused the cut
naming them.
|
| |
|
|
|
|
|
|
|
| |
An event above some heads has each of its dependencies among them or above them, not
only them all in its history. The store holds after its checkpoint only events whose
dependencies are its heads and the events after them, and so it holds every event above
them: one naming an event before them as well is refused by a node that moved, and never
taken by one starting from the checkpoint, which never held what it names. Tests show it
for an event offered after the move and one taken before it.
|
| |
|
|
|
|
|
|
| |
The fold makes a fork's root from the states at heads of one store, or of several, which
merges them, and what makes the fork; the store gives it the states, and the events the
root keeps, from the stores holding them. A node holding those heads checks a root by
building it. A fork and the stores it came from take nothing of each other: what each
writes after builds on what the other doesn't hold.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Once the fold names heads of a later checkpoint (events after the store's, none in
another's history), the store builds the checkpoint at them, keeps what the fold keeps,
forgets what came before them, and refuses every event not above them, with what waits
on such an event. What it forgot is held as accounted for: brought again, it is held,
and an event built on it isn't above the heads. A store starts from a checkpoint its
operator pins, its events building on the heads the checkpoint was built at.
A node starting from a checkpoint must judge the event that named it as every node
does; the fold for the tests counts the heads of the checkpoint a state starts from as
after the checkpoint current at them, so that it does.
|
| |
|
|
|
|
|
|
|
|
| |
Where its history takes an event but the fold has the node refuse it by what it took
before (the federation's second version changing one), the store refuses it as its
own. An operator may have the node drop events taken after its checkpoint, with
everything built on them, and refuse them from then on; what the checkpoint keeps, or
holds by ID, isn't dropped, as every event after it builds on that. The operator takes
either back by allowing it, and what was refused for being built on it, to be offered
again. The fold for the tests shows both with its eras.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A store starts from its root, with the events the root keeps, and holds the events
taken after it. An event offered is taken once the store holds its dependencies, where
it is above the store's heads (built on an event after them, or on all of them) and the
fold takes it at its history: the state its history reads as, folded from the
checkpoint. An event waits for what it builds on, and is taken when that comes; one
built on a refused event, or whose bytes are none of the fold's, is refused, with what
waits for it.
The fold made for the tests judges by history (a put refused where its key is locked),
reads by what counts (a key's latest put, then the lowest ID), refuses by what a node
took before (two eras of one number), and moves to checkpoints (cuts), as the
federation does, so that the later stages' tests have something to exercise.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
`federation`, a feature of its own, builds what `docs/federation.md` and
`docs/store.md` design, stage by stage; without it continuum builds and behaves as it
does. The aliases build with it, and `docs/development.md` says so.
Its first part is the store's: an event's ID, the SHA-256 of its bytes written as 64
lower-case hex digits and read back only so, and the `Fold` trait as `docs/store.md`
gives it. The trait reads a checkpoint's parts too, the heads it was built at and the
events it keeps, which a node taking a pinned checkpoint needs; the design names it.
Nothing uses either yet, but a test.
|
| |
|
|
|
| |
`of`'s doc line sat above `policed`'s, as its first line, and `of` had
none.
|
| |
|
|
|
|
| |
The test of a value hiding the policy's place made its actor through
`automerge::` outside `src/document`, which the test that Automerge
stays behind `document` refuses. It names `document::ActorId`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A node judges what it receives once anything is at the policy's place
(`Screening::policed`), as a read shows it. But a read shows the newest
of the values written at once at a key, merging maps only where that one
is a map: a string written at `_continuum/access` beside the map holding
the policy, and newer, hides it. So the policy's place read as empty,
a change putting `"signed"` into the hidden policy went unjudged where
it came alone, and deleting the string left a strict policy no change
was refused for.
Whether anything is at the policy's place is asked of every map of each
key on the way to it, read or not (`store::held_anywhere`), as
`store::by_seq` walks them. A swarm with nothing there is screened as
before.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A node judges what it receives only once the document holds a policy,
or a batch writes at a key named `policy` (`Screening::policed`); and
an envelope holding `null` at the policy's place reads as none. So a
change putting `"signed"` at `values` in a map beside such an envelope,
writing at no key named `policy`, went unjudged where it came alone,
and a later change deleting the envelope left a strict policy that no
change was refused for. Nodes that took the second in one batch with
others refused it, and the rest dropped it once told: apart until then,
by how changes were batched.
A node judges what it receives once anything is at the policy's place,
whatever it reads as. A swarm with nothing there is screened as before;
one whose policy's place holds what reads as none is judged by none but
the rule that refuses turning strict, as a swarm without a policy is.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Every node refuses a change writing a strict policy where the policy
isn't strict (`rules::turns_strict`), whatever the policy before. But a
node judges its own changes before they leave (`judged_here`) only
under a policy judging every change: in a swarm without one, a strict
policy written through its API was taken there and refused by every
other node, with everything the node built on it.
A change that leaves a policy where there was none to judge it is
judged as every node will judge it, too. A change in a swarm that has no
policy after it is judged by none, as before.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under a strict policy a group of other writes goes as, and is named for,
the last change by history that touched its path, at it, below it or
above it. A change writing its first entry makes the maps above it on
the way, and touches them: where two users wrote their first entries
below one map at once, each making it, the later change touched the
other's path, and the other's write was replayed as its user's, refused
by every node, quarantined.
The change a group goes as is the last that wrote at its path or below
it, or replaced what was at a path above it (`last_written`): one that
made a map above it, finding nothing there at its history, didn't.
Swarms that aren't strict don't ask.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The policy was read in typed JSON, so that an Automerge text spelling
"signed" at its `values`, which no operation `rules::turns_strict` asks
of writes, turns no swarm strict. But that read every policy anew: a
setting that wasn't a string, or a text at `signatures`, made a policy
no node knows in swarms that aren't strict, which read it as before.
The policy is read in plain JSON again, as it was, and only its
strictness asks more (`policy::of`): it reads strict only where its
`values` is a string in typed JSON, an envelope read as its payload.
A policy that would read strict only through a text, at `values` or
holding the policy, is one no node knows. Every policy that doesn't read
strict reads as it did.
|
| |
|
|
|
|
|
|
| |
Under a strict policy a group of other writes goes as the last change
by history that touched its path, above or below it, but was named for
the last that wrote at it or below: where the last replaced a map above
the path, the group went as one change and was judged as another's
user's. It is named for the change it goes as now.
|
| |
|
|
|
|
|
|
| |
A strict `--bootstrap-policy` is refused with `--remake`, but whether
it was strict went by its JSON as given, where the node reads the
policy as written into the document: a strict policy given as an
envelope passed, and its genesis change was refused only once the node
had started. Both now read it as written (`policy::as_written`).
|
| |
|
|
|
|
|
| |
`signs_values` marks, for its thread, that the policy is being read, so
that the reading doesn't ask itself again; a panic within it left the
mark, and that thread read every strict place by Automerge's order from
then on. The mark is now taken off when the reading returns or unwinds.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A swarm turns strict only at its start or through a strict remake, and
a change writing a strict policy where the policy isn't strict is
refused, found by its operations: `"signed"` put at the policy's
`values`, or an envelope asking for it put at its place. But the policy
was read in plain JSON, where an Automerge text reads as a string, and
writing a text is no such operation: `{"$text": "signed"}` at `values`,
through the typed API, turned a swarm strict that nothing refused, with
a time before it nothing closes.
The policy is read in typed JSON now (`store::read_plain_as`): what
continuum writes there reads as it is, plain JSON or an envelope, and a
text, a counter or bytes as itself, tagged; a setting that isn't a
string makes a policy no node knows (`policy::read`), as a version it
doesn't know does. So no text turns a swarm strict, and the operations
`rules::turns_strict` asks of are the only ways to. A policy holding none of these reads
as before.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Under a strict policy, links and other writes go by where their change
is among those replayed, and of one change the links went first. Both
were judged at that change's history, without the other; a link can
only take away there what the other writes relied on (a capability
revoked), never give what they needed, so they go first now.
A group of other writes was placed by its last change by history but
named the user of its newest by clock; it names the user of the last
by history now, as it goes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A strict policy written into a running swarm left a time before it:
changes written there, beside the turn, were refused by the nodes that
took the turn first and taken by the others where they came first (a
signed policy that isn't strict, among them, unseated the turn there);
and a remake whose base preceded the turn had every switching node
replay the turn as one of its own, each refusing the others'.
A change writing a strict policy where the policy at its history isn't
strict (`"signed"` at its `values`, or an envelope there asking for
signed values) is now refused, in every swarm. A swarm turns strict at
its start (`--bootstrap-policy`) or through a strict remake, each its
epoch's first change: no change of a strict epoch is from before its
policy, and the rule for the time before goes, with the walk that found
the changes that turned a swarm strict and what kept them
(`before_strict`, `turned_strict`, `Reads::strict_now`,
`Reads::turned_now`, `store::writers`, `store::made`,
`changes::in_history`). The strict swarm's simulation starts strict.
access.md says so, and that a strict swarm can't move to a policy its
nodes don't know by writing it.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
`--genesis --remake` writes the content as a change of its own before
the one recording the first users and `--bootstrap-policy`. With a
strict policy, that content change was a time before the policy, on
which any member could build a change judged by none.
A strict `--bootstrap-policy` with `--remake` is now refused: a swarm
strict from its start starts empty, and one started from content turns
strict through a strict remake, which keeps only what an operator
looked over. A policy that isn't strict starts from content as before.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Whether values are ordered by `seq` (`signs_values`) read the policy's
place itself, the first value alone and a map by Automerge's choice of
each field, while the policy as judged (`policy::of`) read it through
the store, which orders by `seq` only where `signs_values` says so, and
merges every map there. They parted: a signed policy that isn't strict
beside a newer plain one that is read as not strict for the one and
strict for the other, and two maps, the newer without the field asking
for signed values, the other way round.
`signs_values` now asks `policy::of`, and the store orders the policy's
own place by `seq` wherever any value there asks for signed values, and
what is within the policy as written, so the two are one reading.
Asked from within that reading, it answers false rather than ask again.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under a strict policy, the links of the chains to signed values went in
the order their changes were made, but the other writes were grouped by
time, and a link went before a group only where its time wasn't later.
A write built on what a link grants (a capability in an entry its
manager signed, a ban lifted, a declaration) went first wherever its
clock was behind the link's, was judged where it wasn't granted yet,
and was quarantined, though every node had taken it.
Under a strict policy the other writes now go by where the last change
that wrote them is among those replayed (`between`), with the links,
and keep their times for later replays. Without a strict policy there
are no links, and the groups go by time as before.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Every change judged under a policy that isn't strict, in a strict
document, walked back to the changes that turned it strict, each step
reading every change the document holds. Only changes from the time
before reach it in an honest swarm, but a member can send crafted ones
at an old history, each costing every node a walk.
The changes are now read once per walk (`store::made`), and what the
walk finds is kept for the document's heads (`Reads::turned_now`), as
whether its policy is strict is.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A strict policy could be written over with one that isn't, or deleted,
by a user who may manage the policy. While the swarm was relaxed so,
nothing was asked of the time before it turned strict: a change written
beside that turn was taken, and once the swarm turned strict again,
built on, a node judging that change while strict from the first turn
(one back from away, a joiner) refused it, and every node it told
dropped it with the second turn and everything after.
Under a strict policy, the policy is now written again only as strict:
an envelope there whose value isn't a strict policy, a signed `null`
among them, is refused. So a strict swarm has one change that turned
it, and the time before it stays closed; to leave it, start a new swarm
from its content. A swarm that isn't strict writes its policy as it
did.
|