huskies: merge 731_refactor_migrate_existing_stories_from_slug_based_ids_to_numeric_only

This commit is contained in:
dave
2026-04-27 20:38:03 +00:00
parent 1388658ae8
commit 88f9e5dd54
5 changed files with 357 additions and 3 deletions
+12
View File
@@ -271,6 +271,18 @@ async fn main() -> Result<(), std::io::Error> {
// Migrate items that have an empty name field: derive the name
// from the story ID slug. No-op for items that already have a name.
crdt_state::migrate_names_from_slugs();
// Migrate story IDs from slug form ("664_story_...") to numeric-only
// ("664"). Returns migrated pairs so we can rename filesystem artifacts.
// No-op when all IDs are already numeric.
let id_migrations = crdt_state::migrate_story_ids_to_numeric();
if !id_migrations.is_empty() {
// Derive the project root from the db_path: .huskies/pipeline.db
// lives two levels below the project root.
if let Some(project_root) = db_path.parent().and_then(|p| p.parent()) {
worktree::migrate_slug_paths(project_root, &id_migrations);
}
}
}
}