{"record":{"id":"cf958cbaa5330e27","repo":"deepseek-ai/deepseek-harness","slug":"invalid-attachment-ref","errorCode":"INVALID_ATTACHMENT_REF","errorMessage":"${name} must be a positive integer.","messagePattern":"(.+?) must be a positive integer\\.","errorType":"validation","errorClass":"AttachmentError","httpStatus":null,"severity":"error","filePath":"packages/attachment/attachment-local/src/request-image.ts","lineNumber":73,"sourceCode":"    let projectedHeight = Math.max(1, Math.round(projectedWidth * height / width))\n    while (projectedWidth * projectedHeight > maxPixels && projectedWidth > 1) {\n      projectedWidth -= 1\n      projectedHeight = Math.max(1, Math.round(projectedWidth * height / width))\n    }\n    return { width: projectedWidth, height: projectedHeight }\n  }\n  let projectedHeight = Math.max(1, Math.floor(height * scale))\n  let projectedWidth = Math.max(1, Math.round(projectedHeight * width / height))\n  while (projectedWidth * projectedHeight > maxPixels && projectedHeight > 1) {\n    projectedHeight -= 1\n    projectedWidth = Math.max(1, Math.round(projectedHeight * width / height))\n  }\n  return { width: projectedWidth, height: projectedHeight }\n}\n\nfunction checkedInteger(value: number, name: string): number {\n  if (!Number.isSafeInteger(value) || value <= 0) {\n    throw new AttachmentError(`${name} must be a positive integer.`, 'INVALID_ATTACHMENT_REF')\n  }\n  return value\n}\n\nfunction validatePolicy(policy: ImageRequestPolicy): void {\n  checkedInteger(policy.maxPixels, 'Image request maxPixels')\n  checkedInteger(policy.maxBytes, 'Image request maxBytes')\n}\n\nfunction descriptor(attachment: ImageAttachmentRef, policy: ImageRequestPolicy): string {\n  return JSON.stringify({\n    transformVersion: REQUEST_IMAGE_TRANSFORM_VERSION,\n    attachmentId: attachment.attachmentId,\n    routePixelBudget: policy.maxPixels,\n    encodedByteBudget: policy.maxBytes,\n    encoding: {\n      png: { compressionLevel: 9, palette: 'opaque-only' },\n      webpQualities: REQUEST_IMAGE_QUALITIES,","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/attachment/attachment-local/src/request-image.ts#L55-L91","documentation":"Error \"${name} must be a positive integer.\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/attachment/attachment-local/src/request-image.ts:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a positive integer value for the named parameter."],"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"}