Skip to main content

resolve_stage_prefixes

Function resolve_stage_prefixes 

Source
pub fn resolve_stage_prefixes(
    node: &mut CompositionNode,
    store: &(impl StageStore + ?Sized),
) -> Result<(), PrefixResolutionError>
Expand description

Walk a composition graph and replace any stage IDs that are unique prefixes — or human-authored names — of a real stage in the store with their full 64-character IDs.

Resolution order for {"op": "Stage", "id": "<ref>"}:

  1. <ref> is an exact full-length ID → pass through.
  2. <ref> is a unique hex prefix of one stored ID → use it.
  3. <ref> matches exactly one stored stage’s name field — with Active preferred over Draft/Deprecated — → use that stage’s ID.
  4. Otherwise error with NotFound or Ambiguous.

Hand-authored graphs can therefore reference stages by the name from their spec ({"id": "volvo_map"}) without juggling 8-char prefixes.