{"record":{"id":"8d241ba1f01c9c76","repo":"jdx/mise","slug":"workspace-provider-id-value-cannot-contain","errorCode":null,"errorMessage":"workspace provider ID {value:?} cannot contain ':'","messagePattern":"workspace provider ID (.+?) cannot contain ':'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/workspace.rs","lineNumber":73,"sourceCode":"    fn from_str(value: &str) -> Result<Self> {\n        let Some((provider, local_id)) = value.split_once(':') else {\n            bail!(\"workspace project ID {value:?} must include a provider namespace\");\n        };\n        Self::new(provider, local_id)\n    }\n}\n\nfn validate_id_part(kind: &str, value: &str) -> Result<()> {\n    if value.is_empty() {\n        bail!(\"workspace {kind} ID cannot be empty\");\n    }\n    if value.trim() != value || value.chars().any(char::is_control) {\n        bail!(\n            \"workspace {kind} ID {value:?} contains surrounding whitespace or control characters\"\n        );\n    }\n    if kind == \"provider\" && value.contains(':') {\n        bail!(\"workspace provider ID {value:?} cannot contain ':'\");\n    }\n    Ok(())\n}\n\n/// A project discovered from ecosystem-specific workspace metadata.\n#[derive(Clone, Debug, Eq, PartialEq, Serialize)]\npub(crate) struct WorkspaceProject {\n    /// Stable identity used by dependency edges and task scoping.\n    pub id: ProjectId,\n    /// Normalized path relative to the workspace root. `.` represents the root.\n    pub root: PathBuf,\n    /// Provider-neutral facts that consumers may use for inspection or inference.\n    pub metadata: BTreeMap<String, String>,\n    /// Projects that this project directly depends on.\n    pub dependencies: BTreeSet<ProjectId>,\n    /// Provider and metadata source that inferred this project.\n    pub provenance: WorkspaceProvenance,\n    /// Provider attribution for each inferred dependency edge.","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/task/workspace.rs#L55-L91","documentation":"The provider namespace of a workspace ProjectId must not itself contain `:` because `:` is the namespace separator; a provider like `\"np:m\"` would make `split_once(':')` ambiguous with the local ID. validate_id_part enforces this only for kind == \"provider\".","triggerScenarios":"Calling ProjectId::new(\"np:m\", local) or parsing a string whose first `:`-delimited segment itself contains another `:`, e.g. `\"a:b:c\"` where provider becomes \"a:b\"... actually from_str splits at the first `:` so this triggers when constructing via new with a colon-bearing provider, or collect_provider_projects passes such a value.","commonSituations":"Passing a full namespaced ID as the provider argument (`ProjectId::new(\"npm:pkg\", local)`); provider names derived from URLs or scoped identifiers that include colons; mixing up the two arguments of ProjectId::new.","solutions":["Pass only the bare provider name (e.g. \"npm\") to ProjectId::new, not a namespaced string","Check argument order: first arg is provider, second is the local ID","Strip or normalize scheme prefixes (e.g. drop \"npm:\") before constructing the ID"],"exampleFix":"// before\nProjectId::new(\"npm:pkg\", local)?\n// after\nProjectId::new(\"npm\", \"pkg\")?","handlingStrategy":"validation","validationCode":"// js: provider must be a bare name without ':'\nconst isValidProvider = (p) => !p.includes(':') && p.trim() === p && p.length > 0;\nif (!isValidProvider('npm')) throw new Error('provider must not contain \":\"');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass the bare provider name, never a namespaced ID, to the ID constructor","Check ProjectId::new argument order (provider first, local second)","Strip scheme prefixes like 'npm:' before constructing IDs"],"tags":["workspace","identifier","validation"],"backgroundTag":"invalid-identifier-format","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}