Expand description
Migration to binding v2 — the single-record pipeline format.
Two conversion legs live here, both pure and IO-free (the CLI’s
memstead projection migrate wraps them with the load / write /
tree-removal IO):
- Gen-2 → v2 (
migrate_gen2_bindings): each flat legacy ingest is merged into the projection itsprojectionref names, and the projection’s facet references are folded inline — each referenced facet joins its medium and becomes oneSourceunder the facet’s name, byte-verbatim (source names key sync watermarks). - v1 → v2 (
fold_v1_binding): a three-file-store binding (LegacyBindingV1,source_facetsby name) folds its referenced facets + mediums inline the same way; every other field carries over verbatim andversionbecomes 2.
After both legs every medium/facet record must be consumed
(check_all_consumed) — an orphan (a record no binding references) is a
typed error, never a silent drop; the CLI removes the emptied mediums/
and facets/ trees only after that check passes.
A dangling reference (ingest→projection, projection→facet,
facet→medium) is a typed migrate error, never a silent drop. refinement
build mode is a typed error — the vocabulary is deleted, not migrated.
Structs§
- Legacy
Binding V1 - The retired v1 binding shape (migrate-local): the three-file-store
record that referenced facets by name. Parsed only by the v1→v2 fold leg;
the live loader refuses
version: 1files with the migrate-naming error. - Migrated
Binding - A single migrated binding paired with the identity and provenance the CLI needs to write it to disk and report it.
Enums§
- Binding
Migrate Error - Why a legacy config could not be migrated to a v2 binding. Every variant names the offending record so the failure is diagnosable without re-reading the store.
Functions§
- check_
all_ consumed - Verify every medium/facet record in
configswas consumed by a fold —consumed_facetsis the union of every migrated binding’s(mem, facet-name)pairs. A facet no binding referenced, or a medium no consumed facet engages, is an orphan: removing the trees would drop its content silently, so the migration refuses instead (BindingMigrateError::OrphanRecords) and names each leftover. - fold_
v1_ binding - Fold one v1 three-file-store binding into a v2
Binding: every field carries over verbatim,versionbecomes 2, and eachsource_facetsentry folds its facet + medium inline under the facet’s name byte-verbatim (it keys sync watermarks). Pure — no IO. - migrate_
gen2_ bindings - Migrate every gen-2 flat ingest in
configsinto a v2MigratedBinding, keyed by binding id (<mem>/<stem>), in id order.