Expand description
Agents move (POST /api/v1/agent/move): one agent moved to another computer on the LAN, in one step
(SPEC_MOVE_AN_AGENT_TO_ANOTHER_COMPUTER sections 5 and 6, step D of the build). This is the source’s side; the
destination’s operations are remote_ops::move_ops.
In order: preflight (the destination answers, signed by its install key for this asker and this nonce, with the box
key the move’s content key is sealed to); hand over (the agent is stopped and marked, and its archive written, by
the same export Agents export makes); offer (signed by this install: the person at the destination decides, and
dry_run stops before any of this); transfer (256 KiB sealed chunks, the destination’s bitmap says which are
missing); commit (the destination registers the agent last and answers registered). Only after that answer is the
agent marked moved here. A move that stops anywhere before it leaves the agent handed_over: resume continues it as a
new attempt, bring_back returns it. Who may ask is who may export with a hand-over: the agent’s leader, never the agent
itself.
Structs§
- Destination 🔒
- What the destination said about itself, checked.
- Journal 🔒
- What a move that stopped keeps, so
resumecontinues it: the archive that was written and the move’s name. - Move
Claim 🔒 - Move
Request 🔒 - Tell 🔒
- What telling the peers needs.
Enums§
- Begun 🔒
- What starting a move comes to: the agent was already placed there and the move is finished, or the move goes on with this journal (and whether it is a resumed one).
- Wait 🔒
- Why the wait for the person’s decision ended without it: they (or the clock) said no, so the agent is returned; or the destination could not be reached, so the move is kept to be resumed.
Constants§
- AUDIT_
ACTION 🔒 - CHUNK_
TRIES 🔒 - Tries for one chunk before the move stops (and can be resumed).
- CONSENT_
WAIT 🔒 - How long the person at the destination has to decide (the countdown is 30 s, doubled with no super agent there).
- POLL 🔒
- POLL_
TRIES 🔒 - Questions in a row that may fail while waiting for the person’s decision.
- STD 🔒
Functions§
- audit 🔒
- await_
consent 🔒 - The consent the person at the destination gives, or why not. Polled: the destination answers at once and the countdown runs there.
- begin 🔒
- The agent is handed over (stopped, marked, written to a file) for a first move, or the kept move is taken up again for a resume.
- chunk_
count 🔒 - contents_
of 🔒 - declined 🔒
- The destination refused, or nobody decided: the agent that was handed over for it is returned.
- destination_
key 🔒 - The destination install’s public key, proved by a certificate one of its agents holds: the chain must verify and the install id the certificate names must be the one the peer advertises (an id is derived from its key).
- done 🔒
- The answer of an operation that was done, or why it was not.
- finish 🔒
- The destination registered the agent: it is marked moved here, and the file and the journal are removed.
- handle_
agent_ 🔒move - internal 🔒
- journal_
path 🔒 - move_
agent 🔒 - move_
in_ 🔒flight - Whether a move of
uidis running here now. - moving 🔒
- The agents being moved from here now. One move of an agent at a time, from its hand-over to its answer: a second
moveorresume, or abring_back, of an agent in this set is refused, so the agent never has two lives and two attempts never race. - my_
install 🔒 - This install’s keys.
- offer_
to 🔒 - Sends the offer, after the source’s row for it: who asked, what is offered, to which computer. A row says sizes and counts, never content.
An offer the destination refuses is a
refusedrow too, with its reason, so the trail does not end atoffered. - preflight 🔒
- read_
full 🔒 - read_
journal 🔒 - refused_
row 🔒 - The
refusedrow of an offer the destination did not take, with its reason; nothing for any other answer. - release_
kept_ 🔒move - Before
bring_backclears the mark of an agent whose move stopped: the destination is asked to end that move, because it may have registered the agent with only its answer lost, and the agent would then live in both places. The agent comes back only when the destination says the move is ended (it holds nothing of it any more) or whenforcesays it is not there; a destination that cannot be reached, or that already placed the agent, keeps it handed over. The kept archive is removed. - run 🔒
- stopped_
row 🔒 - A step of the move stopped it (the destination could not be reached, or an answer was not the one a step needs): the move’s trail
ends with a
stoppedrow saying why, under the move id, and the agent stays handed over so the move can be resumed. - tell_
peers 🔒 - The statement that the name moved, signed by this install and sent to every other computer on the LAN: the ones that pinned the name under this install move their pin when the new key shows up, and the others refuse it as they do not hold the name. Best effort: a computer not reached falls back to accepting the key by hand. How many accepted it.
- transfer 🔒
- Sends every chunk the destination is missing, one at a time, each tried a few times.
- unreachable 🔒
- write_
journal 🔒