Expand description
Gen-2 four-primitive → binding v1 migration (D10, gen-2 path).
Converts the current four-primitive store (per-mem Projection + flat
[Ingest]) into v1 BindingV1 records: each flat ingest is merged into
the projection its projection ref names, collapsing the
declaration/schedule split into one versioned binding. The canonical
binding id is <mem>/<stem> — the projection’s owning mem dir plus its
file stem, i.e. the very string the ingest already used as its projection
ref (D3).
migrate_gen2_bindings is pure and IO-free — it transforms
already-loaded PipelineConfigs into keyed bindings. The CLI
(memstead projection migrate) wraps it with the load / write / validate
IO. This module is additive and un-wired: it neither flips the loader
version-gate (D2) nor implements the gen-1 root-folder path (also D10) —
those are separate, later slices.
§Field mapping (gen-2 → v1)
version= 1 (BINDING_VERSION).intent/source_facets/reference_mems/destination_mem/rules— carried over from theProjectionverbatim.deny_paths— moved up from the per-ingest record to the binding (strategy-invariant, E1); bare directory segments are rewritten to E1’s workspace-relative glob dialect where trivially derivable (see [to_glob_dialect]), every rewrite recorded as a note.coverage_semantics— defaultsCoverageSemantics::Exhaustive(gen-2 has no such field).operations.build— the ingest’smode/trigger/batch_size/post_actions.modemapsdiscovery→BuildMode::Discoveryandone-shot→BuildMode::OneShot;refinementis a typed migrate error (BindingMigrateError::RefinementModeDeleted) — the vocabulary is deleted, not migrated (D1).operations.sync/operations.verify—None. A gen-2 config declares only the build-equivalent schedule; sync/verify are enabled later viaprojection enable, never fabricated by migration.
A dangling ingest→projection ref is a typed migrate error
(BindingMigrateError::DanglingProjectionRef), never a silent drop (D10).
Structs§
- 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 gen-2 config could not be migrated to a v1 binding. Every variant names the offending ingest so the failure is diagnosable without re-reading the store.
Functions§
- migrate_
gen2_ bindings - Migrate every gen-2 flat ingest in
configsinto a v1MigratedBinding, keyed by binding id (<mem>/<stem>, D3), in id order. - resolve_
migrated_ binding - Resolve a migrated binding’s primary sources (facet + medium) via the
binding resolve layer, so the produced binding can be validated against the
D6 capability matrix (
crate::binding::validate_binding).