{"record":{"id":"8fc32d306f4af53f","repo":"Hmbown/CodeWhale","slug":"manifestname-checksum-mismatch-for-name","errorCode":null,"errorMessage":"${manifestName} checksum mismatch for ${name}","messagePattern":"(.+?) checksum mismatch for (.+?)","errorType":"console","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/release/assemble-release-assets.js","lineNumber":76,"sourceCode":"      `${label} does not match the authoritative inventory` +\n        `${missing.length > 0 ? `; missing: ${missing.join(\", \")}` : \"\"}` +\n        `${unexpected.length > 0 ? `; unexpected: ${unexpected.join(\", \")}` : \"\"}` +\n        `${actual.size !== actualNames.length ? \"; duplicate basenames are present\" : \"\"}`,\n    );\n  }\n}\n\nasync function assertManifest(directory, manifestName, expectedNames) {\n  const manifestPath = path.join(directory, manifestName);\n  const checksums = parseChecksumManifest(\n    await fs.readFile(manifestPath, \"utf8\"),\n    manifestName,\n  );\n  assertExactNames([...checksums.keys()], expectedNames, manifestName);\n  for (const name of expectedNames) {\n    const actual = await sha256(path.join(directory, name));\n    if (checksums.get(name) !== actual) {\n      throw new Error(`${manifestName} checksum mismatch for ${name}`);\n    }\n  }\n}\n\nasync function verifyAssetDirectory(directory) {\n  const entries = await fs.readdir(directory, { withFileTypes: true });\n  const nonFiles = entries.filter((entry) => !entry.isFile());\n  if (nonFiles.length > 0) {\n    throw new Error(\n      `Release asset directory must be flat; found: ${nonFiles.map((entry) => entry.name).join(\", \")}`,\n    );\n  }\n\n  const expected = allReleaseAssetNames();\n  assertExactNames(entries.map((entry) => entry.name), expected, \"Release asset directory\");\n  await assertManifest(directory, CHECKSUM_MANIFEST, checksummedReleaseAssetNames());\n  await assertManifest(directory, BUNDLE_CHECKSUM_MANIFEST, BUNDLE_ASSET_NAMES);\n  console.log(`Verified ${expected.length} release assets in ${directory}`);","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/scripts/release/assemble-release-assets.js#L58-L94","documentation":"assertManifest first checks the manifest's name set against the expected inventory (via assertExactNames), then recomputes the sha256 of every expected asset and compares it to the digest recorded in the manifest. Any digest that does not match the actual file bytes throws this Error naming the manifest and the file.","triggerScenarios":"An asset file was modified (rebuilt with different content, re-zipped, re-timestamped) after the manifest was generated, or the manifest contains a digest from a different build.","commonSituations":"Editing an asset (e.g. adding a file to a zip) after generating SHA256SUMS, downloading a partially-updated artifact set, or copying an old manifest over new artifacts.","solutions":["Regenerate the checksum manifest from the current files: `sha256sum * > SHA256SUMS`.","Re-download or rebuild the named asset so its bytes match the recorded digest.","Verify you are comparing against the manifest from the same release build, not a previous one."],"exampleFix":"// before\n# app.zip rebuilt after SHA256SUMS was written\n// after\nsha256sum assets/* > SHA256SUMS  # regenerate after every asset change","handlingStrategy":"validation","validationCode":"import { createHash } from 'node:crypto';\nconst digest = createHash('sha256').update(await fs.readFile(asset)).digest('hex');\nconst recorded = manifestRows.get(basename(asset));\nif (recorded && recorded.toLowerCase() !== digest) throw new Error(`stale manifest for ${asset}`);","typeGuard":null,"tryCatchPattern":"try { await assertManifest(dir, names, manifestName); } catch (e) { if (String(e.message).includes('checksum mismatch')) { console.error('Regenerate SHA256SUMS or rebuild the asset:', e.message); process.exitCode = 1; } else throw e; }","preventionTips":["Regenerate SHA256SUMS after every change to any asset.","Never edit assets after manifest generation.","Verify checksums in CI immediately after building, before publishing."],"tags":["checksums","sha256","release"],"backgroundTag":"checksum-mismatch","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"}