Explicit deterministic runtime schema migration
runtime_migration.RdCreates migration registries, registers adjacent schema transformations, resolves contiguous migration paths, and explicitly migrates integrity-protected runtime envelopes while producing deterministic audit records.
Usage
new_runtime_migration_registry()
register_runtime_migration(
registry,
kind,
from_version,
to_version,
migrate,
id
)
runtime_migration_path(
registry,
kind,
from_version,
to_version = unname(runtime_schema_versions()[[kind]])
)
migrate_runtime_integrity_envelope(envelope, registry)Arguments
- registry
A
PopgenVCFRuntimeMigrationRegistry.- kind
A registered runtime artifact kind.
- from_version
The positive integer source schema version.
- to_version
The positive integer target schema version.
- migrate
A deterministic function transforming one payload version into the next.
- id
A stable, non-empty migration step identifier.
- envelope
A current or explicitly supported legacy runtime integrity envelope.
Value
new_runtime_migration_registry() and
register_runtime_migration() return migration registries.
runtime_migration_path() returns an ordered list of migration entries.
migrate_runtime_integrity_envelope() returns a
PopgenVCFRuntimeMigrationResult containing the migrated current envelope
and its canonical migration record.
Details
Migrations are explicit and fail closed. Only adjacent registered steps are accepted. Source envelopes are integrity-validated before transformation, each step is executed twice to detect nondeterminism, and the final payload is placed inside a new envelope using the current schema. Ordinary artifact readers remain unchanged and continue to reject legacy schemas unless migration is invoked explicitly.