{"record":{"id":"a4bb8567480f51a5","repo":"paperclipai/paperclip","slug":"attachment-backed-artifact-metadata-is-required","errorCode":null,"errorMessage":"Attachment-backed artifact metadata is required","messagePattern":"Attachment-backed artifact metadata is required","errorType":"http","errorClass":null,"httpStatus":422,"severity":"error","filePath":"server/src/routes/issues.ts","lineNumber":8412,"sourceCode":"        actorId: actor.actorId,\n        agentId: actor.agentId,\n        runId: actor.runId,\n        agentApiKeyId: actor.agentApiKeyId,\n        action: \"issue.document_unlocked\",\n        entityType: \"issue\",\n        entityId: issue.id,\n        details: {\n          key: result.document.key,\n          documentId: result.document.id,\n          title: result.document.title,\n        },\n      });\n    }\n\n    res.json(result.document);\n  });\n\n  router.get(\"/issues/:id/documents/:key/revisions\", async (req, res) => {\n    const id = req.params.id as string;\n    const issue = await getAccessibleResource(req, res, getIssueById(req, id), \"Issue not found\");\n    if (!issue) return;\n    if (!(await assertIssueReadAllowed(req, res, issue))) return;\n    const keyParsed = issueDocumentKeySchema.safeParse(String(req.params.key ?? \"\").trim().toLowerCase());\n    if (!keyParsed.success) {\n      res.status(400).json({ error: \"Invalid document key\", details: keyParsed.error.issues });\n      return;\n    }\n    const revisions = await documentsSvc.listIssueDocumentRevisions(issue.id, keyParsed.data);\n    res.json(revisions);\n  });\n\n  router.post(\n    \"/issues/:id/documents/:key/revisions/:revisionId/restore\",\n    validate(restoreIssueDocumentRevisionSchema),\n    async (req, res) => {\n      const id = req.params.id as string;","sourceCodeStart":8394,"sourceCodeEnd":8430,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/issues.ts#L8394-L8430","documentation":"422 on work product update. Fires when the patch would leave an attachment-backed (paperclip) artifact without required attachment metadata: metadata is absent from the patch and the existing record does not already satisfy the paperclip attachment metadata requirements, so the update is rejected.","triggerScenarios":"Thrown at server/src/routes/issues.ts:7825 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include the required field(s) in the request path, query, or body as named by the error message, then retry.","Check the API contract in packages/shared validators for the exact required shape of this endpoint."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}