{"record":{"id":"9cc09182c738ea52","repo":"astrid-runtime/astrid","slug":"notfound","errorCode":"NotFound","errorMessage":"trusted Windows authority boundary does not exist: {}","messagePattern":"trusted Windows authority boundary does not exist: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-core/src/platform_fs/windows/path.rs","lineNumber":231,"sourceCode":"            let (handle, identity) = if let Some(parent) = components.last() {\n                open_directory_identity_relative(\n                    parent.handle.0,\n                    component.as_os_str(),\n                    current == path,\n                )?\n            } else if current == path {\n                open_locked_directory(&current)?\n            } else {\n                open_directory_identity(&current, true)?\n            };\n            components.push(LockedPathComponent {\n                path: current.clone(),\n                identity,\n                handle,\n            });\n        }\n        if components.last().map(|component| component.path.as_path()) != Some(path) {\n            return Err(io::Error::new(\n                io::ErrorKind::NotFound,\n                format!(\n                    \"trusted Windows authority boundary does not exist: {}\",\n                    path.display()\n                ),\n            ));\n        }\n        // System ancestors such as the volume root and `Users` deliberately\n        // grant limited authority to principals outside Astrid's trust set.\n        // They remain open as identity handles while the caller-selected owned\n        // directory is the rename-locked ACL authority boundary. Critical\n        // child mutations resolve relative to that boundary handle, so an\n        // ancestor rename cannot redirect the operation into another tree.\n        let result = Self {\n            components,\n            authority_boundary: path.to_path_buf(),\n        };\n        validate_trusted_parent_acl_handle(","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-core/src/platform_fs/windows/path.rs#L213-L249","documentation":"This NotFound error is raised by `TrustedPathGuard::capture` when the walk over path components never produced a locked component whose path equals the requested path — i.e. the authority boundary directory itself does not exist. Intermediate missing components are skipped (NotFound continues the loop), so only a fully missing final boundary yields this error after the loop, distinguishing it from intermediate not-found cases.","triggerScenarios":"Calling `TrustedPathGuard::capture` (as done by `prepare_executable_transaction`, `acquire_named_private_lock`, staging, and verify_contract flows) with a path that does not exist on disk, was deleted between planning and capture, or whose final component is a file rather than a created directory; also a non-rooted/relative path that never sets `rooted`, leaving `components` empty.","commonSituations":"A staging/temp directory that a previous run cleaned up; a typo'd or env-dependent base directory (`%PROGRAMDATA%` variant not present); running the installer flow before the install directory is created; passing a relative path where an absolute local path is required.","solutions":["Create the boundary directory (recursively, as real directories) before capturing the guard.","Verify the path exists and is a directory: `path.is_dir()` before capture, and fail with your own message if not.","Ensure you pass an absolute local path (drive-letter rooted); relative or UNC-redirected paths are not valid boundaries.","Check for cleanup races: another process or a previous failed run may have removed the directory; recreate it."],"exampleFix":"// before\nlet base = Path::new(env_var_or_default(\"MYAPP_BASE\")); // may not exist\nlet guard = TrustedPathGuard::capture(base)?; // NotFound\n\n// after\nlet base = PathBuf::from(env_var_or_default(\"MYAPP_BASE\"));\nstd::fs::create_dir_all(&base)?;\nassert!(base.is_absolute());\nlet guard = TrustedPathGuard::capture(&base)?;","handlingStrategy":"validation","validationCode":"if !path.is_absolute() {\n    return Err(\"authority boundary must be an absolute local path\".into());\n}\nstd::fs::create_dir_all(&path)?; // ensure the boundary exists before capture\nlet guard = TrustedPathGuard::capture(&path)?;","typeGuard":"fn boundary_ready(p: &Path) -> bool {\n    p.is_absolute() && p.is_dir()\n}","tryCatchPattern":"match TrustedPathGuard::capture(&path) {\n    Err(e) if e.kind() == io::ErrorKind::NotFound\n        && e.to_string().contains(\"authority boundary does not exist\") => {\n        std::fs::create_dir_all(&path)?;\n        let guard = TrustedPathGuard::capture(&path)?;\n    }\n    other => other?,\n}","preventionTips":["Always `create_dir_all` the boundary directory before capturing a guard.","Assert the path is absolute and drive-rooted; relative paths never root the component walk.","Guard against concurrent cleanup: recreate the directory if a previous run removed it.","Validate env-derived base directories exist at startup, not deep inside transactions."],"tags":["windows","filesystem","directory-not-found"],"backgroundTag":"directory-not-found","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"}