{"record":{"id":"bd65a9ba9359266c","repo":"github/spec-kit","slug":"shared-infrastructure-path-escapes-project-root","errorCode":null,"errorMessage":"Shared infrastructure path escapes project root: {label}","messagePattern":"Shared infrastructure path escapes project root: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/shared_infra.py","lineNumber":171,"sourceCode":"    \"\"\"Return the bundled/source shared scripts directory.\"\"\"\n    if core_pack and (core_pack / \"scripts\").is_dir():\n        return core_pack / \"scripts\"\n    return repo_root / \"scripts\"\n\n\ndef _shared_destination_label(project_path: Path, dest: Path) -> str:\n    try:\n        return dest.relative_to(project_path).as_posix()\n    except ValueError:\n        return str(dest)\n\n\ndef _shared_relative_path(project_path: Path, dest: Path) -> Path:\n    try:\n        rel = dest.relative_to(project_path)\n    except ValueError:\n        label = _shared_destination_label(project_path, dest)\n        raise ValueError(f\"Shared infrastructure path escapes project root: {label}\") from None\n\n    if rel.is_absolute() or \"..\" in rel.parts:\n        label = _shared_destination_label(project_path, dest)\n        raise ValueError(f\"Shared infrastructure path escapes project root: {label}\")\n    return rel\n\n\ndef _ensure_safe_shared_directory(\n    project_path: Path,\n    directory: Path,\n    *,\n    create: bool = True,\n    context: str = \"shared infrastructure directory\",\n) -> None:\n    \"\"\"Create a shared infra directory without following symlinked parents.\"\"\"\n    root = project_path.resolve()\n    rel = _shared_relative_path(project_path, directory)\n    current = project_path","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/shared_infra.py#L153-L189","documentation":"Error \"Shared infrastructure path escapes project root: {label}\" thrown in github/spec-kit.","triggerScenarios":"Thrown at src/specify_cli/shared_infra.py:171 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Move the shared infrastructure path inside the project root, or adjust the project root."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}