Skip to main content

migrate

Function migrate 

Source
pub fn migrate(spec: &Spec, analysis: &Analysis) -> Result<Spec, Invalid>
Expand description

spec as this version reads it (draftwright.spec/3), with the exact face-ID map applied throughout its keys and string references. A version 1 spec additionally has each dimension’s key rewritten to the form it now has (R1 invariant 9: a change of form is read, never guessed at):

  • d:<feature>/<parameter>@<view> becomes d:<feature>/<parameter>: the view was where the plan routed it, not a decision, so the entry does not keep it as its view;
  • a PMI dimension’s feature, pmi:<category>:#<n> (its record’s Part 21 instance), becomes the record’s item ID in analysis (crate::pmi::Report::identities), when the spec is bound to the analysis’s file (or to none): a Part 21 instance names a record only in its own file. A key whose record is not in the analysis, has no ID, or is of another file, is kept as it was, for plan to refuse with the nearest IDs.

Two keys that come to one are ambiguous, and refused with both as the candidates. Anything but a known schema is refused; old schemas expire at the named legacy-reader cutoff.