{"record":{"id":"7af78837eb791e51","repo":"paperclipai/paperclip","slug":"completion-cites-no-registered-attachment-on-this-task-use","errorCode":null,"errorMessage":"Completion cites no registered attachment on this task. Use register_deliverable for the requested file and cite deliverable:<attachmentId> from its receipt. No human completion approval was created.","messagePattern":"Completion cites no registered attachment on this task\\. Use register_deliverable for the requested file and cite deliverable:<attachmentId> from its receipt\\. No human completion approval was created\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/native-runtime/native-deliverable-feedback.ts","lineNumber":116,"sourceCode":"    ...result.completionClaim.criteria.flatMap(({ evidenceRefs }) => evidenceRefs),\n  ]);\n  let registeredAttachment = false;\n  for (const value of refs) {\n    if (typeof value !== \"string\") continue;\n    const ref = value.trim();\n    const attachmentPath = /^\\/api\\/attachments\\/([^/?#]+)\\/content(?:[?#].*)?$/u.exec(ref);\n    if (ref.startsWith(\"deliverable:\") || attachmentPath) {\n      const id = attachmentPath?.[1] ?? ref.slice(\"deliverable:\".length);\n      const uuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;\n      const [attachment] = uuid.test(id)\n        ? await db.select({ id: issueAttachments.id, originatingRunId: issueAttachments.originatingRunId,\n            filename: assets.originalFilename, byteSize: assets.byteSize, sha256: assets.sha256 }).from(issueAttachments)\n            .innerJoin(assets, and(eq(assets.id, issueAttachments.assetId), eq(assets.companyId, binding.companyId)))\n            .where(and(eq(issueAttachments.id, id), eq(issueAttachments.companyId, binding.companyId), eq(issueAttachments.issueId, binding.issueId)))\n            .limit(1)\n        : [];\n      if (!attachment) {\n        throw new Error(\"Completion cites no registered attachment on this task. Use register_deliverable for the requested file and cite deliverable:<attachmentId> from its receipt. No human completion approval was created.\");\n      }\n      // A prior output (or user input) can be useful context, but does not prove\n      // this run published the newly requested output. The receipt survives a\n      // controller restart of this run; a replacement can re-register preserved\n      // workspace bytes internally rather than asking the user to confirm them.\n      if (fileRequested && attachment.originatingRunId !== binding.runId) continue;\n      if (fileRequested && !await hasCurrentPublicationReceipt(db, binding.companyId, binding.semanticToolReceipts, attachment)) {\n        throw new Error(\"This attachment has no matching verified publication receipt for this run's requested output. Inspect any preserved file and use register_deliverable to verify its current filename, size, and SHA-256, then cite the new receipt. No human completion approval was created.\");\n      }\n      registeredAttachment = true;\n      continue;\n    }\n    // URLs and typed durable refs are not workspace paths. Verification commands\n    // belong in verification; do not scan prose or upload files named by a model.\n    const localFile = /^(?:file:|\\.{0,2}\\/|[a-z]:[\\\\/])/iu.test(ref)\n      || (!/^[a-z][a-z0-9+.-]*:/iu.test(ref) && /^[^\\r\\n]+\\.[a-z0-9]{1,16}(?::\\d+(?::\\d+)?)?$/iu.test(ref));\n    if (localFile && (fileRequested || artifactRefs.has(value))) {\n      throw new Error(\"Completion cites a workspace-only file that the user cannot download. Before finishing, use register_deliverable for requested file outputs and cite deliverable:<attachmentId> from the receipt, with /api/attachments/<attachmentId>/content as the download link. For repository changes, cite an accessible PR or registered work product instead. No human completion approval was created.\");","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/server/src/services/native-runtime/native-deliverable-feedback.ts#L98-L134","documentation":"validateNativeDeliverableEvidence checks that a completion citing deliverable:<attachmentId> points to a registered issue attachment on the same task and company. When the cited attachment ID does not resolve to any issueAttachments row joined to its asset, the runtime rejects it and clarifies that no human completion approval was created as a side effect. This prevents fabricated deliverable citations.","triggerScenarios":"nativeCompletionFeedback / verifyReceipt referencing deliverable:<id> where the id is hallucinated, from a different issue/company, or where register_deliverable was never actually called for the requested file.","commonSituations":"Model invents an attachment ID instead of reading the receipt returned by register_deliverable; copy-pasting an attachment ID from a different task; register_deliverable failed earlier and the model cites the intended-but-unregistered ID.","solutions":["Run register_deliverable for the requested file and cite the deliverable:<attachmentId> exactly as printed in its receipt","Verify the cited attachment belongs to this task (issueId) and company","If the file cannot be registered, report the concrete blocker instead of citing an unregistered attachment"],"exampleFix":"// before\nDeliverable: deliverable:42\n// after\nDeliverable: deliverable:9c1e8b4d-4a2f-4c1e-8b4d-4a2f4c1e8b4d // from register_deliverable receipt","handlingStrategy":"validation","validationCode":"const receipt = await registerDeliverable(file);\nconst cited = receipt.attachmentId; // cite deliverable:<cited> exactly; never invent IDs\nif (!cited) throw new Error(\"register_deliverable did not return an attachmentId; do not cite a deliverable.\");","typeGuard":"const resolvableCitation = (id, knownReceipts) => knownReceipts.some(r => r.attachmentId === id && r.issueId === issueId);","tryCatchPattern":"try { await feedback(payload); } catch (e) { if (e.message.includes(\"no registered attachment\")) { /* re-run register_deliverable and cite the returned deliverable:<id> */ } else throw e; }","preventionTips":["Always cite the deliverable:<attachmentId> string copied verbatim from the register_deliverable receipt","Never fabricate or reuse attachment IDs across tasks","Confirm register_deliverable succeeded (check its receipt) before writing the completion report"],"tags":["deliverables","validation","attachments"],"backgroundTag":"record-not-found","analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-22T01:17:13.364Z"}