{"record":{"id":"b0fa770105efd57f","repo":"jdx/mise","slug":"validated-registry-min-version","errorCode":null,"errorMessage":"validated registry min_version","messagePattern":"validated registry min_version","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/registry.rs","lineNumber":183,"sourceCode":"}\n\n#[derive(Debug, Clone)]\npub(crate) struct RegistryBackend {\n    pub full: &'static str,\n    pub platforms: &'static [&'static str],\n    pub min_version: Option<&'static str>,\n    pub options: &'static [(&'static str, &'static str)],\n}\n\nimpl RegistryBackend {\n    fn supports_version(&self, request: &str) -> bool {\n        let Some(minimum) = self.min_version else {\n            return true;\n        };\n        // Validated when loading both bundled and floating registries. This\n        // boundary is explicitly restricted to semver tools; it never orders\n        // backend version lists or interprets opaque lockfile versions.\n        let minimum = semver::Version::parse(minimum).expect(\"validated registry min_version\");\n        let request = request.strip_prefix(\"prefix:\").unwrap_or(request);\n        let request = request.trim_start_matches(['v', 'V']);\n        if let Ok(version) = semver::Version::parse(request) {\n            return !version.cmp_precedence(&minimum).is_lt();\n        }\n        // A numeric prefix is excluded only when the entire prefix is below\n        // the boundary. Let the backend resolve prefixes that overlap it.\n        let parts = request.split('.').collect::<Vec<_>>();\n        if !(1..=2).contains(&parts.len()) {\n            return true;\n        }\n        let Some(parts) = parts\n            .into_iter()\n            .map(|part| {\n                if part.is_empty()\n                    || !part.bytes().all(|c| c.is_ascii_digit())\n                    || (part.len() > 1 && part.starts_with('0'))\n                {","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/registry.rs#L165-L201","documentation":"This is an internal invariant panic in mise's registry version check (src/registry.rs supports_version). Each registry entry carries a min_version, and the loader is expected to have already validated it parses as semver. When a request's version string is compared against that minimum, parse(minimum).expect fires if the stored minimum was never validated — meaning invalid registry data reached this code path.","triggerScenarios":"A registry (bundled or floating/user-supplied) is loaded with a min_version that bypassed or evaded load-time semver validation, then supports_version is called with a version request (e.g. checking whether registry entry supports 'prefix:1.2' or a 'v'-prefixed version).","commonSituations":"Hand-edited or third-party floating registry files with typos in min_version; a regression in registry load validation; tool versions with non-semver conventions interacting with a bad stored minimum.","solutions":["Locate the registry entry whose min_version is invalid and fix it to a valid semver string (e.g. '1.2.0', not 'v1.2' or 'latest').","Run the registry validation (mise's registry loading/validation step) to identify the offending entry.","If using a custom/floating registry, update it to a version whose min_version is valid, or pin the bundled registry copy.","Report a bug if this occurs with the bundled registry — it indicates the load-time validation invariant is broken."],"exampleFix":"// registry/ node with invalid min_version\n// before\n[tools.node]\nmin_version = \"v18\"\n// after\n[tools.node]\nmin_version = \"18.0.0\"","handlingStrategy":"validation","validationCode":"// before trusting a registry entry\nfn valid_min_version(e: &RegistryEntry) -> bool {\n    e.min_version.as_deref().map(|v| semver::Version::parse(v).is_ok()).unwrap_or(true)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate every registry min_version with semver::Version::parse at load time.","Never hand-edit registry files without re-running mise's registry validation.","Keep custom/floating registries pinned to reviewed revisions."],"tags":["registry","semver","invariant","panic"],"backgroundTag":"internal-invariant-violation","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"}