{"record":{"id":"b3b9dc9a4e30c591","repo":"santifer/career-ops","slug":"the-release-pointer-does-not-carry-a-sha256-digest","errorCode":null,"errorMessage":"the release pointer does not carry a sha256 digest: ${url}","messagePattern":"the release pointer does not carry a sha256 digest: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"plugins/h1b-sponsor/install-h1b-index.mjs","lineNumber":126,"sourceCode":"  });\n  if (out.status) throw new Error(`could not read the release pointer (HTTP ${out.status}): ${url}`);\n  if (out.oversized) throw new Error(`the release pointer is implausibly large: ${url}`);\n\n  let doc;\n  try {\n    doc = JSON.parse(String(out.text || ''));\n  } catch {\n    throw new Error(`the release pointer is not JSON: ${url}`);\n  }\n  if (!doc || typeof doc !== 'object') throw new Error(`the release pointer is not an object: ${url}`);\n\n  const filename = String(doc.filename || '');\n  if (!FILENAME_RE.test(filename)) {\n    throw new Error(`the release pointer names an unusable index filename (${JSON.stringify(doc.filename)}): ${url}`);\n  }\n  const sha256 = String(doc.sha256 || '').trim().toLowerCase();\n  if (!SHA256_RE.test(sha256)) {\n    throw new Error(`the release pointer does not carry a sha256 digest: ${url}`);\n  }\n  // Recorded, never acted on, so a missing or odd value costs a label rather\n  // than the install. Bounded because it lands in a file on disk.\n  const version = doc.version === undefined || doc.version === null\n    ? null\n    : String(doc.version).slice(0, 64);\n  return { filename, sha256, version };\n}\n\n/**\n * Stream the asset to `tmpFile`, hashing as it goes, and return the digest.\n *\n * Streamed rather than buffered: the body is millions of times the size of\n * anything else this plugin reads, and readBoundedText's 1 MiB ceiling exists\n * precisely because nothing on the API path should ever be this big. Hashing\n * during the write means the file is never read a second time to verify it.\n */\nasync function downloadAsset(fetchImpl, url, tmpFile) {","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/plugins/h1b-sponsor/install-h1b-index.mjs#L108-L144","documentation":"The pointer must carry a sha256 digest matching SHA256_RE so the downloaded archive can be integrity-checked. When `sha256` is missing, empty, or not a 64-char hex digest, the installer throws instead of downloading an archive it could not verify.","triggerScenarios":"Running install-h1b-index.mjs against a pointer document whose sha256 field is absent, blank, uppercase-with-junk, truncated, or otherwise not a valid lowercase 64-hex-digit digest after trim().","commonSituations":"Hand-rolled mirror pointer where the author forgot to compute the digest; a regenerated archive whose pointer was not updated; editing the pointer by hand and pasting a short or 'TODO' value.","solutions":["Regenerate the sha256 (e.g. `sha256sum h1b-index.sqlite.zst`) and publish the full 64-character lowercase hex digest in the pointer.","If you do not control the pointer, switch to the official pointer URL, which always carries a valid digest.","Validate before publishing: `echo <digest> | grep -E '^[0-9a-f]{64}$'`."],"exampleFix":"// before\n{\"filename\":\"h1b-index.sqlite.zst\",\"sha256\":\"TODO\"}\n// after\n{\"filename\":\"h1b-index.sqlite.zst\",\"sha256\":\"9f2c...64-hex...e1\"}","handlingStrategy":"validation","validationCode":"const doc = JSON.parse(text);\nif (!/^[0-9a-f]{64}$/.test(String(doc?.sha256 ?? '').trim().toLowerCase())) {\n  throw new TypeError('pointer sha256 missing or malformed');\n}","typeGuard":"const hasValidDigest = (doc) => typeof doc?.sha256 === 'string' && /^[0-9a-f]{64}$/.test(doc.sha256.trim().toLowerCase());","tryCatchPattern":"try {\n  await installH1bIndex();\n} catch (e) {\n  if (e.message.includes('does not carry a sha256')) {\n    console.error('Pointer lacks a valid sha256; regenerate with sha256sum and republish the pointer.');\n  } else throw e;\n}","preventionTips":["Compute the digest with sha256sum immediately after building the archive and paste it into the pointer.","Keep digest lowercase hex, exactly 64 chars.","CI-check pointers with a regex before publishing."],"tags":["validation","security","checksum"],"backgroundTag":"checksum-mismatch","analyzedSha":"aac998c7ed7248ea853b720ceeb1fdbeb322fc5d","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}