{"record":{"id":"f5f5538378de83c8","repo":"Hmbown/CodeWhale","slug":"not-a-regular-non-reparse-file","errorCode":null,"errorMessage":"not a regular non-reparse file","messagePattern":"not a regular non-reparse file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":8975,"sourceCode":"    let metadata = file.metadata()?;\n    anyhow::ensure!(\n        metadata.is_file() && metadata.nlink() == 1,\n        \"not one regular file\"\n    );\n    Ok((metadata.dev(), metadata.ino()))\n}\n\n#[cfg(windows)]\nfn runtime_store_file_identity(file: &File) -> Result<(u64, u64)> {\n    use std::os::windows::fs::MetadataExt as _;\n    use std::os::windows::io::AsRawHandle as _;\n    use windows_sys::Win32::Storage::FileSystem::{\n        BY_HANDLE_FILE_INFORMATION, FILE_ATTRIBUTE_REPARSE_POINT, GetFileInformationByHandle,\n    };\n\n    let metadata = file.metadata()?;\n    let safe = metadata.is_file() && metadata.file_attributes() & FILE_ATTRIBUTE_REPARSE_POINT == 0;\n    anyhow::ensure!(safe, \"not a regular non-reparse file\");\n    let mut info = BY_HANDLE_FILE_INFORMATION::default();\n    // SAFETY: the handle and writable output remain valid for the call.\n    if unsafe { GetFileInformationByHandle(file.as_raw_handle(), &mut info) } == 0 {\n        return Err(std::io::Error::last_os_error()).context(\"Inspect Runtime store file identity\");\n    }\n    anyhow::ensure!(info.nNumberOfLinks == 1, \"has multiple filesystem links\");\n    Ok((\n        u64::from(info.dwVolumeSerialNumber),\n        (u64::from(info.nFileIndexHigh) << 32) | u64::from(info.nFileIndexLow),\n    ))\n}\n\n#[cfg(all(not(unix), not(windows)))]\nfn runtime_store_file_identity(file: &File) -> Result<(u64, u64)> {\n    anyhow::ensure!(file.metadata()?.is_file(), \"must be a regular file\");\n    Ok((0, 0))\n}\n","sourceCodeStart":8957,"sourceCodeEnd":8993,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/runtime_threads.rs#L8957-L8993","documentation":"Windows guard in runtime_store_file_identity: the file's metadata has the FILE_ATTRIBUTE_REPARSE_POINT flag or is not a regular file. A reparse point could redirect the identity check to a different target, so the (volume-serial, file-index) identity used to detect store-file swaps is refused up front.","triggerScenarios":"Thrown at crates/tui/src/runtime_threads.rs:8975 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the file with fsutil reparsepoint query and remove any junction/symlink/other reparse tag on the store path","Replace the store path with a plain regular file (copy, delete link, rename back)","Exclude the runtime store directory from tools that create reparse points"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}