use std::path::PathBuf;
use serde::Serialize;
pub const VACUUM_BEFORE_MIGRATE: &str = "advisory (cross-lane, sweep lane): run `haem vacuum --sweep` BEFORE migrating a \
garbage-heavy store — reclaim unreachable nodes before re-chunking live data (§7.2). \
This does not gate the build; it is the recommended operational sequencing.";
pub const MANIFEST_BRACKET: &str = "cross-lane (sweep lane): branch-head rewrites use the record store's atomic install; the \
doc-1 manifest `Updating` bracket applies where a manifest exists — the manifest write \
authority lands with the sweep lane.";
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum MigrationDirection {
Forward,
Abort,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum MigrationOutcome {
AlreadyInTargetFormat,
MigratedToV2,
AbortedToV1,
}
#[derive(Debug, Serialize)]
pub struct MigrationReport {
pub data_dir: PathBuf,
pub outcome: MigrationOutcome,
pub direction: MigrationDirection,
pub source_policy: String,
pub target_policy: String,
pub shard_count: usize,
pub shards_rebuilt: usize,
pub shards_unchanged: usize,
pub shards_empty: usize,
pub branch_heads_rebuilt: usize,
pub branch_heads_unchanged: usize,
pub duration_ms: u128,
pub vacuum_before_migrate: &'static str,
pub manifest_bracket: &'static str,
}