Expand description
What moves over the wire, and how it is applied.
The transfer payload is a delta-scoped backup artifact — backup artifacts are
explicitly “constructed from a list of assets, albums, and so on,” so a delta-scoped one
needs no special construction path (build_delta_artifact). It is fetched with ranged
GET (pull_artifact over the shared RangedFetcher), which makes the transfer
resumable across the flaky-by-nature LAN and idempotent — content-addressing turns a
re-fetch of an already-held blob into a no-op.
A received artifact is ingested through the backup restore path (ingest) — peering
adds no separate deserialization. Restore re-verifies every ciphertext hash, checks STREAM
tags on decrypt, and runs each manifest through verify_asset. Peering adds on top:
- Chain-aware forward-vs-stale reconciliation. A peer pull cannot resurrect an asset the local device has already superseded — even if the artifact was honestly produced from an older state of the sender. Such an asset is quarantined, never silently applied.
- No resurrection. An asset the device holds a tombstone for (kept past purge) is refused.
- All-or-nothing per asset. Each asset restores on its own: one that fails to decrypt, or arrives without the metadata its manifest commits to, is not applied, and does not stop the rest.
The artifact is sealed under the session’s ArtifactSecret, derived from the channel’s TLS
exporter — never a user passphrase.
Over a verified peering channel the ranged pull runs through ChannelBlobSource
(pull_over_channel): the same fetch engine, the same content-address check, and a pull
severed with the channel resumes on the next channel after the bytes it already holds.
Structs§
- Artifact
Blob Source - An in-memory
BlobSourcethat serves an artifact’s bytes overRangerequests — the deterministic stand-in for the peering channel’s rangedGET. It records every served range (so a test can prove zero duplicate bytes on resume) and can inject a single mid-transfer LAN drop (a short read) to exercise the resume path. - Channel
Blob Source - A
BlobSourceover a verified peering channel (PeerClient), resuming afterheld: the bytes of the artifact this device already holds from an earlier, severed pull. A range insideheldis answered locally; only the bytes after it cross the channel, so a resumed pull re-fetches nothing it already holds. Every byte that arrives is appended toheld, so a pull severed again keeps what it got. - Delta
Export - Everything needed to assemble a delta-scoped artifact on the sending device.
- Local
Library - The receiving device’s state an ingest reconciles against.
- Peer
Restore - The outcome of ingesting a peered artifact: every asset the artifact carried lands in exactly one bucket.
Functions§
- artifact_
address - The content address (SHA-256 hex) of an assembled artifact, for the ranged-GET integrity
check. Byte-identical to the media server’s
/blob/{hash}addressing. - build_
delta_ artifact - Build a delta-scoped backup artifact: include exactly the sender’s assets whose content
address is in
delta, then export through the ordinary backup path. Assets the receiver already holds are never indelta, so they never enter the artifact — the “only missing assets transfer” guarantee is structural, decided before a single byte is sealed. - ingest
- Ingest a peered artifact through the backup restore path with chain-aware reconciliation.
- pull_
artifact - Pull an artifact over ranged
GET, reusing the adverse-hardenedRangedFetcher. Each request resumes from the current buffer length, so an interruption re-fetches zero bytes already held, and the reassembled bytes must hash toartifact_hashor the transfer fails — the same resumability and content-address verification the server download path relies on. - pull_
over_ channel - Pull the artifact
address(lenbytes) from the serving peer overclient, through the same resumable, content-address-verified ranged fetch aspull_artifact.