{"record":{"id":"4e462230a116b64d","repo":"deepseek-ai/deepseek-harness","slug":"attachment-corrupt","errorCode":"ATTACHMENT_CORRUPT","errorMessage":"Prepared attachment bytes do not match their reference.","messagePattern":"Prepared attachment bytes do not match their reference\\.","errorType":"exception","errorClass":"AttachmentError","httpStatus":null,"severity":"error","filePath":"packages/attachment/attachment-local/src/store.ts","lineNumber":191,"sourceCode":"    durableHomes.add(home)\n  }\n  return home\n}\n\n/**\n * Publish one already verified normalized image below a versioned attachment root.\n * @param root - absolute `DSH_HOME/attachments/v1` root.\n * @param prepared - deterministic normalized bytes and reference.\n * @returns durable content-addressed normalized image reference.\n */\nexport async function commitPreparedImageFile(\n  root: string,\n  prepared: PreparedImageFile,\n): Promise<ImageAttachmentRef> {\n  const normalized = prepared.data\n  const sha256 = ensureReference(prepared.ref)\n  if (digest(normalized) !== sha256 || normalized.byteLength !== prepared.ref.bytes) {\n    throw new AttachmentError('Prepared attachment bytes do not match their reference.', 'ATTACHMENT_CORRUPT')\n  }\n  const bucket = join(root, 'objects', sha256.slice(0, 2))\n  const staging = join(root, 'tmp')\n  // Establish DSH_HOME itself against the filesystem root once per process.\n  // Every process performs that proof independently, so observing a directory\n  // another process created can never be mistaken for durable publication.\n  const boundary = await ensureDurableHome(dirname(dirname(resolve(root))))\n  await ensureDurableDirectory(bucket, boundary)\n  await ensureDurableDirectory(staging, boundary)\n  const temporary = join(staging, randomUUID())\n  const target = objectPath(root, sha256)\n  let handle\n  try {\n    handle = await open(temporary, constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY, 0o600)\n    await handle.writeFile(normalized)\n    await handle.sync()\n    await handle.close()\n    handle = undefined","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/attachment/attachment-local/src/store.ts#L173-L209","documentation":"Error \"Prepared attachment bytes do not match their reference.\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/attachment/attachment-local/src/store.ts:191 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-prepare the attachment so its bytes hash to the reference id."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}