Repository navigation
feat: add atomic doctor migrate-spans for existing repositories - #335
Open
geekgonecrazy wants to merge 1 commit into
Open
geekgonecrazy wants to merge 1 commit into
geekgonecrazy wants to merge 1 commit into
Conversation
Add `atomic doctor migrate-spans`, an un-flagged command that migrates an existing repository to native span recording by durably requiring the span-range-graph v3 capability lease. The transition is metadata-only: existing changes stay graph-origin and remain fully readable, records after the migration are span-based, and mixed operation is supported (proven by the existing mixed-fixture span tests). Legacy span repositories on capability version 2 are raised in place; the ambiguous pre-release version 1 envelope is refused (this build refuses to open such repositories anyway). The migration journals a repository-scoped Repair operation carrying the capability lease (absent or observed version raised to v3) with a same-transaction verified receipt, so an interrupted process leaves either nothing or a complete journal entry. An already-migrated repository is an idempotent no-op that journals nothing. `--dry-run` reports the current span-capability state without writing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
atomic doctor migrate-spans— a command available in every standard build (not gated behind theexperimental-span-importcargo feature, which only affectsatomic git import --span) that migrates an existing repository to native span recording by durably requiring thespan-range-graphv3 capability lease. Until now the only front doors to spans weregit import --span(behindexperimental-span-import) and silent adoption when pulling span changes from someone else; there was no supported way to deliberately enable spans on a normal repo.What migration means
This is a metadata-only transition — no change bytes, graph rows, or views are touched:
span-range-graphv3. Existing changes stay graph-origin and remain fully readable; new records are span-based. Mixed operation is already proven by the existing mixed-fixture span tests (record_mixed_fixtureetc.).recordrefused with "span capability version 2 requires migration before recording" and importing new span changes refused with a matching error — but nothing performed the migration.Safety
Repairoperation (same recipe asrepair_tree_bijection): theMetadataTarget::Capabilitylease (Absent/Some(2)→Some(3)), before/after evidence digests, CAS'd repository heads, and a same-transaction verified receipt — an interrupted process leaves either nothing or a complete journal entry.put_required_capabilityis raise-only, so a concurrent raise can never be lowered.CLI
--dry-runreports the current span-capability state (not required / legacy vN / v3) without writing anything.Testing
atomic-repository/tests/span_capability_migration.rs):None → 3, journaledRepairop with lease + verified receipt + repository head; graph content still reads; post-migration record is span-indexed; second migrate is an idempotent no-oprecordrefuses before migration, works after the raisecargo test -p atomic-repository --lib: 1577 passedcargo test -p atomic-cli --bin atomic: 2168 passed-p atomic-repository -p atomic-cli --all-targets): no new warnings;cargo fmtclean