{"record":{"id":"c601db4f830dc042","repo":"affaan-m/ECC","slug":"nasiko-version-is-not-qualified-for-normalize","errorCode":null,"errorMessage":"Nasiko ${version} is not qualified for ${normalized.os}/${normalized.arch}.","messagePattern":"Nasiko (.+?) is not qualified for (.+?)/(.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/nasiko-release.js","lineNumber":46,"sourceCode":"  }),\n});\n\nfunction normalizePlatform(platform = process.platform, architecture = process.arch) {\n  const osName = platform === 'win32' ? 'windows' : platform;\n  if (!['linux', 'darwin', 'windows'].includes(osName)) throw new Error(`Unsupported platform: ${platform}`);\n  const arch = architecture === 'x64' ? 'amd64' : architecture;\n  if (!['amd64', 'arm64'].includes(arch)) throw new Error(`Unsupported architecture: ${architecture}`);\n  if (osName === 'windows' && arch !== 'amd64') throw new Error(`Unsupported architecture for Windows: ${architecture}`);\n  return { os: osName, arch, binaryName: osName === 'windows' ? 'nasiko.exe' : 'nasiko' };\n}\n\nfunction getQualifiedRelease(version, platform = process.platform, architecture = process.arch) {\n  if (!/^v\\d+\\.\\d+\\.\\d+$/.test(String(version || ''))) {\n    throw new Error('Nasiko installation requires a pinned version such as v0.1.0; latest is not allowed.');\n  }\n  const normalized = normalizePlatform(platform, architecture);\n  const qualification = QUALIFIED_RELEASES[version]?.[`${normalized.os}/${normalized.arch}`];\n  if (!qualification) throw new Error(`Nasiko ${version} is not qualified for ${normalized.os}/${normalized.arch}.`);\n  return { version, ...normalized, ...qualification, license: LICENSE, sourceUrl: SOURCE_URL };\n}\n\nfunction digestBytes(bytes) {\n  return `sha256:${crypto.createHash('sha256').update(bytes).digest('hex')}`;\n}\n\nfunction assertDigest(bytes, expectedDigest, label) {\n  if (!SHA256_PATTERN.test(expectedDigest)) throw new Error(`${label} has an invalid expected digest.`);\n  const actual = digestBytes(bytes);\n  if (actual !== expectedDigest) throw new Error(`${label} digest mismatch: expected ${expectedDigest}, got ${actual}.`);\n}\n\nfunction validateManifest(bytes) {\n  let manifest;\n  try { manifest = JSON.parse(bytes.toString('utf8')); } catch (_error) { throw new Error('Nasiko manifest is not valid JSON.'); }\n  if (manifest.schemaVersion !== 2 || !Array.isArray(manifest.layers) || manifest.layers.length !== 1) {\n    throw new Error('Nasiko manifest must contain exactly one OCI layer.');","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/nasiko-release.js#L28-L64","documentation":"getQualifiedRelease looks up the version in the QUALIFIED_RELEASES matrix by 'os/arch'. If the version is pinned correctly but no entry exists for that platform combination, it throws — meaning that version was never qualified (digest-pinned) for that target. This prevents installing binaries without verified checksums.","triggerScenarios":"getQualifiedRelease('v0.1.0', 'darwin', 'arm64') when v0.1.0 only ships linux/amd64 etc.; a version string that passes the regex but doesn't exist in QUALIFIED_RELEASES at all (undefined optional-chained to undefined qualification).","commonSituations":"New hardware (Apple Silicon, ARM servers) before a release adds its digests; asking for a future/older version not in the matrix; matrix out of date after upgrading the plugin.","solutions":["Check QUALIFIED_RELEASES in scripts/lib/nasiko-release.js for supported os/arch combos for your version","Pick a version qualified for your platform, or a platform qualified for your version","Update the ECC plugin so the release matrix includes the new version/platform"],"exampleFix":"// before\ngetQualifiedRelease('v0.1.0', 'darwin', 'arm64'); // not qualified\n// after\ngetQualifiedRelease('v0.2.0', 'darwin', 'arm64'); // qualified combo","handlingStrategy":"validation","validationCode":"// requires reading the module's matrix\nconst { QUALIFIED_RELEASES } = require('./scripts/lib/nasiko-release.js');\nconst key = `${os}/${arch === 'x64' ? 'amd64' : arch}`;\nif (!QUALIFIED_RELEASES[version]?.[key]) {\n  throw new Error(`${version} has no qualified build for ${key}`);\n}","typeGuard":"function isQualified(version, os, arch) {\n  return Boolean(QUALIFIED_RELEASES[version]?.[`${os}/${arch}`]);\n}","tryCatchPattern":"try {\n  const rel = getQualifiedRelease(version, platform, arch);\n} catch (e) {\n  if (e.message.includes('is not qualified for')) {\n    console.error('Pick a version/platform pair in QUALIFIED_RELEASES.');\n  } else throw e;\n}","preventionTips":["Check the release matrix before adding new platform/version combos to CI","Pin versions known to ship your arch (e.g. darwin/arm64 support)","Keep the ECC plugin updated so new release qualifications are present"],"tags":["versioning","platform","validation"],"backgroundTag":"resource-not-found","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}