{"record":{"id":"9470530e65ef8255","repo":"jdx/mise","slug":"workspace-project-id-has-root-root-that-es","errorCode":null,"errorMessage":"workspace project {id:?} has root {root:?} that escapes the workspace root","messagePattern":"workspace project (.+?) has root (.+?) that escapes the workspace root","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/workspace.rs","lineNumber":1202,"sourceCode":"        })\n        .collect()\n}\n\nfn normalize_project_root(id: &ProjectId, root: &Path) -> Result<PathBuf> {\n    if root.is_absolute() {\n        bail!(\n            \"workspace project {id:?} has absolute root {root:?}; roots must be workspace-relative\"\n        );\n    }\n\n    let mut normalized = PathBuf::new();\n    for component in root.components() {\n        match component {\n            Component::CurDir => {}\n            Component::Normal(component) => normalized.push(component),\n            Component::ParentDir => {\n                if !normalized.pop() {\n                    bail!(\n                        \"workspace project {id:?} has root {root:?} that escapes the workspace root\"\n                    );\n                }\n            }\n            Component::RootDir | Component::Prefix(_) => {\n                bail!(\n                    \"workspace project {id:?} has absolute root {root:?}; roots must be workspace-relative\"\n                );\n            }\n        }\n    }\n    if normalized.as_os_str().is_empty() {\n        normalized.push(\".\");\n    }\n    Ok(normalized)\n}\n\nfn normalize_workspace_path(path: &Path) -> Result<PathBuf> {","sourceCodeStart":1184,"sourceCodeEnd":1220,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/task/workspace.rs#L1184-L1220","documentation":"While normalizing a workspace project's relative root, a ParentDir (\"..\") component with no remaining parent means the path climbs above the workspace root. mise rejects this to keep every project inside the workspace directory tree.","triggerScenarios":"A [workspace.project] root such as \"../shared\" or \"a/../../b\" where popping parent components empties the normalized path for project {id}.","commonSituations":"Referencing a sibling directory outside the workspace via \"..\"; refactoring roots after moving a project deeper without adjusting relative paths.","solutions":["Rewrite the root as a path that stays inside the workspace (no leading \"..\")","Move the referenced project directory into the workspace","If a shared project must live outside, restructure the workspace so the workspace root encloses it"],"exampleFix":"# before\n[workspace.project.shared]\nroot = \"../shared\"\n# after\n[workspace.project.shared]\nroot = \"shared\"","handlingStrategy":"validation","validationCode":"fn stays_inside_workspace(root: &std::path::Path) -> bool {\n    let mut depth = 0usize;\n    for c in root.components() {\n        match c {\n            std::path::Component::ParentDir => {\n                if depth == 0 { return false; }\n                depth -= 1;\n            }\n            std::path::Component::Normal(_) => depth += 1,\n            _ => {}\n        }\n    }\n    true\n}","typeGuard":"let inside_ws = |p: &std::path::Path| stays_inside_workspace(p);","tryCatchPattern":"if let Err(e) = normalize_project_root(&id, &root) {\n    if e.to_string().contains(\"escapes the workspace root\") {\n        eprintln!(\"root must not climb above the workspace root\");\n    }\n}","preventionTips":["Avoid leading \"..\" in project roots; restructure so projects live inside the workspace","After moving a project deeper, rewrite its root rather than adding \"..\" segments","Lint workspace configs for any root beginning with \"..\""],"tags":["workspace","config","path-traversal"],"backgroundTag":"path-traversal-blocked","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}