{"record":{"id":"3276e02700dbf626","repo":"Hmbown/CodeWhale","slug":"label-contains-an-invalid-checksum-row-trimmed","errorCode":null,"errorMessage":"${label} contains an invalid checksum row: ${trimmed}","messagePattern":"(.+?) contains an invalid checksum row: (.+?)","errorType":"console","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/release/assemble-release-assets.js","lineNumber":40,"sourceCode":"  ].join(\"\\n\");\n}\n\nasync function sha256(filePath) {\n  const hash = crypto.createHash(\"sha256\");\n  hash.update(await fs.readFile(filePath));\n  return hash.digest(\"hex\");\n}\n\nfunction parseChecksumManifest(content, label) {\n  const checksums = new Map();\n  for (const line of content.split(/\\r?\\n/)) {\n    const trimmed = line.trim();\n    if (!trimmed) {\n      continue;\n    }\n    const match = trimmed.match(/^([a-fA-F0-9]{64})\\s+\\*?(.+)$/);\n    if (!match) {\n      throw new Error(`${label} contains an invalid checksum row: ${trimmed}`);\n    }\n    const name = match[2];\n    if (checksums.has(name)) {\n      throw new Error(`${label} contains duplicate checksum rows for ${name}`);\n    }\n    checksums.set(name, match[1].toLowerCase());\n  }\n  return checksums;\n}\n\nfunction assertExactNames(actualNames, expectedNames, label) {\n  const actual = new Set(actualNames);\n  const expected = new Set(expectedNames);\n  const missing = expectedNames.filter((name) => !actual.has(name));\n  const unexpected = actualNames.filter((name) => !expected.has(name));\n  if (missing.length > 0 || unexpected.length > 0 || actual.size !== actualNames.length) {\n    throw new Error(\n      `${label} does not match the authoritative inventory` +","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/release/assemble-release-assets.js#L22-L58","documentation":"parseChecksumManifest parses a SHA256SUMS-style file where each non-empty line must match /^([a-fA-F0-9]{64})\\s+\\*?(.+)$/. A line that does not contain a 64-hex-digit digest followed by a filename causes this Error naming the manifest and the offending line.","triggerScenarios":"A checksums file line with a truncated digest (e.g. 32 hex chars), a digest containing non-hex characters (g-z), missing whitespace between digest and filename, an empty filename, or an accidental non-checksum line (a header or prose) in the manifest.","commonSituations":"Hand-edited SHA256SUMS files, manifests generated by non-sha256sum tools (e.g. md5 digests), or copy-paste introducing wrapped/truncated lines.","solutions":["Regenerate the manifest with `sha256sum *` (or an equivalent 64-hex digest) so every line matches the expected format.","Open the manifest, find the line printed in the message, and fix or delete it.","Remove stray non-checksum lines (headers, notes) from the file."],"exampleFix":"// before (manifest line)\nad3f...  app.zip  (short digest)\n// after\nsha256sum app.zip > SHA256SUMS","handlingStrategy":"validation","validationCode":"// validate each manifest line before handing the file to the script\nconst ok = text.split('\\n').every(l => { const t = l.trim(); return !t || /^[a-fA-F0-9]{64}\\s+\\*?.+$/.test(t); });\nif (!ok) throw new Error('SHA256SUMS has malformed rows');","typeGuard":null,"tryCatchPattern":"try { await checksums(manifestPath); } catch (e) { if (String(e.message).includes('invalid checksum row')) { console.error('Fix or regenerate SHA256SUMS:', e.message); process.exitCode = 1; } else throw e; }","preventionTips":["Always generate manifests with sha256sum, never by hand.","Strip non-checksum lines before writing the manifest.","Validate manifest format in CI before release assembly."],"tags":["checksums","release","parsing"],"backgroundTag":"invalid-argument-format","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}