Skip to main content

Module origin_map

Module origin_map 

Source
Expand description

Origin alignment across two deployments (#220, RFC 13 §4.4): which host in snapshot b is which host in snapshot a, and on what evidence.

“It works in staging” is unfalsifiable on a bus until two fleets can be compared subject by subject — and RFC 03 §1.1 makes that possible, because publishing identity sits at one fixed base-relative position. Two fleets whose hosts are entirely different h-… values can be aligned origin to origin, and then sysinfo/cpu/usage on the one is sysinfo/cpu/usage on the other.

The one way this could be a bad idea is being clever about it: a wrong pairing produces confident nonsense. So the rules are few, ordered, and never guess:

  1. Explicit — the operator said --map a=b. Both ends must exist in their snapshot; a pairing that names an unknown origin is an error at the edge, not a silent no-op.
  2. Label — the source label the identity bridge carries (RFC 06 §6.2: state/<producer>/health and state/<producer>/sensor carry host_id beside source), when it is verified (host_id is the origin the document sits under) and unique among the still-unpaired origins on both sides.
  3. Producer set — the set of producer names an origin publishes under, when it is unique among the still-unpaired origins on both sides. Two identical hosts share a fingerprint and stay unpaired until the operator maps them; that is the point.

Anything left is Unmapped with a reason that names the count it failed on — “label pve claimed by 2 origins in b”, “producer set {sysinfo} matches 3 origins in a”, “no health/sensor row: label not asked” — because “I cannot map these” is both the honest answer and the useful one. The plan lists them; the diff refuses over them (diff_normalized).

Pure: two Snapshots in hand become two profile lists become one MapPlan. Only host origins are profiled — a service origin (@catalog) is the same chunk in every deployment and compares verbatim.

Structs§

Label
The source label an origin’s identity-bridge documents carry, and whether they certify it.
MapPlan
What the alignment decided: the pairs it can stand behind, and every origin it could not pair, with the reason.
OriginProfile
One host origin as a snapshot shows it: what it publishes, and what it calls itself.

Enums§

MapError
An explicit pairing the plan refuses — an error at the edge, because silently ignoring a --map would compare the wrong keys.

Functions§

origin_profiles
Profile every host origin a snapshot holds, in origin order.
plan_map
Plan the alignment: explicit pairs, then verified unique labels, then unique producer sets; the rest listed with reasons. Deterministic — explicit pairs in the order given, everything else in origin order.