{"record":{"id":"09eb205e7c3ed90d","repo":"astral-sh/ruff","slug":"project-directory-project-path-does-not-contai","errorCode":null,"errorMessage":"project directory `{project_path}` does not contain a base name","messagePattern":"project directory `(.+?)` does not contain a base name","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ty_completion_eval/src/main.rs","lineNumber":277,"sourceCode":"    db: ProjectDatabase,\n    dir: SystemPathBuf,\n    name: String,\n    cursor: Cursor,\n    settings: ty_ide::CompletionSettings,\n}\n\nimpl Task {\n    /// Create a new task for the Python project at `project_path`.\n    ///\n    /// `truth` should correspond to the completion configuration and the\n    /// expected answer for completions at the given `cursor` position.\n    fn new(\n        project_path: &SystemPath,\n        truth: &CompletionTruth,\n        cursor: Cursor,\n    ) -> anyhow::Result<Task> {\n        let name = project_path.file_name().ok_or_else(|| {\n            anyhow::anyhow!(\"project directory `{project_path}` does not contain a base name\")\n        })?;\n\n        let system = OsSystem::new(project_path);\n        let mut project_metadata = ProjectMetadata::discover(project_path, &system)?;\n        // Explicitly point ty to the .venv to avoid any set VIRTUAL_ENV variable to take precedence.\n        project_metadata.apply_override_options(Options {\n            environment: Some(EnvironmentOptions {\n                python: Some(RelativePathBuf::cli(\".venv\")),\n                ..EnvironmentOptions::default()\n            }),\n            ..Options::default()\n        });\n        let db = ProjectDatabase::fallible(project_metadata, system)?;\n        Ok(Task {\n            db,\n            dir: project_path.to_path_buf(),\n            name: name.to_string(),\n            cursor,","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/astral-sh/ruff/blob/672bb4edf04c84f8b0753346359daee4057158f2/crates/ty_completion_eval/src/main.rs#L259-L295","documentation":"`Task::new` derives each eval task's display name from `project_path.file_name()`; on all platforms `file_name()` returns None only for degenerate paths (`/`, `.`, or paths ending in `..`). Since the path here is the temp copy of a truth fixture directory, this is an internal harness invariant over the truth tree layout rather than a normal user-input error.","triggerScenarios":"A truth fixture project path that resolves to a root-like or `..`-terminated path — e.g. a fixture created directly at a filesystem root, or harness path handling producing a degenerate path. Practically unreachable with a normal checkout.","commonSituations":"Exotic truth-tree layouts produced by scripts or manual experimentation; harness bugs after refactoring the temp-copy logic.","solutions":["Keep truth fixtures as ordinary named subdirectories under `crates/ty_completion_eval/truth/`","If hit with an untouched checkout, preserve the command and fixture tree and report it upstream as a harness bug"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"case \"$DIR\" in /|.|*..) echo \"degenerate project path: $DIR\" >&2; exit 2;; esac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep truth fixtures as ordinary named subdirectories of `truth/`","Do not script fixture creation at filesystem roots or with `..` components","Report untouched-tree occurrences upstream as harness bugs"],"tags":["evaluation","paths","invariant","internal"],"backgroundTag":null,"analyzedSha":"672bb4edf04c84f8b0753346359daee4057158f2","analyzedAt":"2026-08-16T08:54:05.464Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}