{"record":{"id":"b9156a29a9f175d6","repo":"astrid-runtime/astrid","slug":"automatic-migration-of-unreleased-windows-layout-o","errorCode":null,"errorMessage":"automatic migration of unreleased Windows layout-one homes is unsupported; use the explicit developer importer","messagePattern":"automatic migration of unreleased Windows layout-one homes is unsupported; use the explicit developer importer","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"crates/astrid-core/src/dirs_layout.rs","lineNumber":461,"sourceCode":"                    )\n                })?;\n            },\n            Err(error) => return Err(error),\n        }\n    }\n}\n\nfn path_entry_present(path: &Path) -> io::Result<bool> {\n    match std::fs::symlink_metadata(path) {\n        Ok(_) => Ok(true),\n        Err(error) if error.kind() == io::ErrorKind::NotFound => Ok(false),\n        Err(error) => Err(error),\n    }\n}\n\n#[cfg(windows)]\nfn reject_automatic_windows_layout_one() -> io::Result<()> {\n    Err(io::Error::new(\n        io::ErrorKind::Unsupported,\n        \"automatic migration of unreleased Windows layout-one homes is unsupported; use the explicit developer importer\",\n    ))\n}\n\n#[cfg(not(windows))]\n#[expect(\n    clippy::unnecessary_wraps,\n    reason = \"the cross-platform migration gate has one fallible signature\"\n)]\nfn reject_automatic_windows_layout_one() -> io::Result<()> {\n    Ok(())\n}\n\n#[cfg(not(target_family = \"wasm\"))]\nfn ensure_migration_capacity(target: &Path, source_bytes: u64) -> io::Result<()> {\n    let available = fs2::available_space(target)?;\n    ensure_available_migration_capacity(available, source_bytes)","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-core/src/dirs_layout.rs#L443-L479","documentation":"On Windows builds, reject_automatic_windows_layout_one unconditionally rejects the v1→v2 migration for layout-one homes: Windows layout-one homes were never released, so the library refuses to migrate them automatically and returns io::ErrorKind::Unsupported, directing developers to the explicit developer importer. This gate runs inside both begin_layout_v2_migration and complete_layout_v2.","triggerScenarios":"Calling begin_layout_v2_migration or complete_layout_v2 on a Windows build against a home whose sentinel is the legacy layout-one version. Any legacy-version home on Windows triggers this immediately, before any path or content checks.","commonSituations":"Running a Windows development build against an old test home from an unreleased Windows layout; CI or a developer machine on Windows hitting the legacy sentinel left in a test fixture.","solutions":["Use the explicit developer importer tool as the error message directs, instead of the automatic migration path","If the Windows home is disposable test data, delete it (or its sentinel) and let Astrid create a fresh v2 home","Run the migration on a non-Windows host if the home genuinely originated there, then move the migrated home","Confirm you actually intend to migrate a layout-one home — current-version (v2) homes skip this gate entirely"],"exampleFix":"// before: automatic migration on Windows\nhome.begin_layout_v2_migration(&target)?; // Unsupported\n// after: use the developer importer\n// astrid-dev import-layout-one --home ~/.astrid\n// or, for throwaway data:\nstd::fs::remove_dir_all(\"~/.astrid\")?; // recreate fresh v2 home","handlingStrategy":"fallback","validationCode":"#[cfg(windows)]\nfn needs_developer_importer(home: &AstridHome) -> bool {\n    home.layout_version().ok().flatten().as_deref() == Some(astrid_core::LEGACY_LAYOUT_VERSION)\n}","typeGuard":"fn automatic_migration_available() -> bool {\n    !cfg!(windows)\n}","tryCatchPattern":"match home.begin_layout_v2_migration(&target) {\n    Err(e) if e.kind() == std::io::ErrorKind::Unsupported\n        && e.to_string().contains(\"Windows layout-one\") => {\n        // invoke the developer importer or recreate the home\n    },\n    r => r?,\n}","preventionTips":["Detect Windows + legacy sentinel at startup and route to the importer instead of the migration API","Treat unreleased Windows layout-one homes as disposable dev data","Cross-check platform before scheduling automatic migrations in CI","Keep test fixtures on current layout version to avoid the gate"],"tags":["windows","migration","unsupported-platform"],"backgroundTag":"unsupported-platform","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}