pub struct RemoteAsset {
pub path: String,
pub download_url: String,
pub content_type: Option<String>,
pub size: Option<u64>,
pub sha256: Option<String>,
pub change_token: Option<String>,
}Fields§
§path: String§download_url: String§content_type: Option<String>§size: Option<u64>§sha256: Option<String>The digest the coordinate was PUBLISHED with, when the source knew
one: Cargo.lock’s checksum, PyPI’s sha256 digest. Lowercase hex,
no algorithm prefix.
It exists so the bytes that cross the airgap are the bytes the lockfile pinned. Before this field the agent parsed both digests and threw them away: a compromised registry or CDN serving substituted bytes for one pinned coordinate had them packed into the znippy archive and certified by a receipt whose sha256 was computed over the substitution. The allowlist and https stopped a network-position attacker; nothing stopped the origin itself.
None means the source published no digest — it does NOT mean the bytes
are trusted, and a connector that has one must fill it in.
change_token: Option<String>An opaque CHANGE TOKEN for this coordinate, as published by THIS source.
Equal ⇒ unchanged at this source. Different ⇒ changed at this source. It is never compared across sources, and it is never a content digest: it may bind the path, the storage layout, or anything else the source finds cheap, so two sources holding byte-identical artifacts will legitimately publish different tokens. Anything that treats it as a hash of the bytes is wrong.
§Why it exists
15 of holger’s 17 repository backends are znippy-*, and a znippy file
table carries neither a modification time nor a per-entry SHA-256 — so
ArtifactEntry::published_unix_ms and ArtifactEntry::sha256 are
both None and every such repository landed in unproven on every
mirror tick, re-fetching itself whole every cycle under the default
UnprovenPolicy::Refetch. What znippy DOES have,
for free, is a merkle fold of the per-chunk BLAKE3 hashes its index
already stores — a value that is stable while the bytes are stable and
differs when they differ, and which is emphatically not a content
digest. That is a change token, and this is the field for it.
§The scope is part of the value
A token carried here is SCOPE-STAMPED: "<scope>|<opaque>", where the
scope names the source it came from and the part after the first | is
never interpreted. [scope_change_token] builds one, and
[split_change_token] takes it apart. A comparison between two tokens
with different scopes is refused rather than answered — which is what
makes “never compared across sources” a property of the code instead of
a rule someone has to remember.
None means this source published no token. It does NOT mean the bytes
are unchanged and it does not mean they changed.