{"record":{"id":"30e976be0f547875","repo":"paperclipai/paperclip","slug":"expected-five-documented-annotations-for-screen-screen-id","errorCode":null,"errorMessage":"Expected five documented annotations for screen ${screen.id}","messagePattern":"Expected five documented annotations for screen (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"doc/plans/chat-adapters/generate-wireframes.mjs","lineNumber":197,"sourceCode":"      [\"Comments and messaging\", \"GitHub · Linear · Notion · Telegram\", \"Token/app + resource allowlist\", \"Thread and mention rules vary\"],\n      [\"Phone, social, and email\", \"WhatsApp · Twilio · X · Resend · iMessage\", \"Sender identity + webhook\", \"Media, window, and rate limits vary\"],\n    ],\n    notes: [\"Provider taxonomy drives setup fields without cloning the wizard.\", \"Capability rows name supported, fallback, and unavailable behavior.\", \"Shared states cover loading, empty, degraded, denied, rate-limited, revoked, and dead letter.\"],\n  },\n];\n\nconst uiSurfaceSpec = readFileSync(join(root, \"2026-09-03-chat-adapters-ui-surfaces.md\"), \"utf8\");\nconst annotationMap = new Map(\n  [...uiSurfaceSpec.matchAll(/### (\\d{2})[^\\n]*\\n\\nPurpose:[^\\n]*\\n\\n((?:\\d+\\.[^\\n]*\\n){5})/g)].map((match) => [\n    match[1],\n    match[2].trim().split(\"\\n\").map((line) => line.replace(/^\\d+\\.\\s*/, \"\")),\n  ]),\n);\n\nfor (const screen of screens) {\n  screen.annotations = annotationMap.get(screen.id);\n  if (!screen.annotations || screen.annotations.length !== 5) {\n    throw new Error(`Expected five documented annotations for screen ${screen.id}`);\n  }\n}\n\nconst esc = (value) => String(value)\n  .replaceAll(\"&\", \"&amp;\")\n  .replaceAll(\"<\", \"&lt;\")\n  .replaceAll(\">\", \"&gt;\")\n  .replaceAll('\"', \"&quot;\");\n\nconst text = (x, y, value, size = 14, fill = \"#000\", extra = \"\") =>\n  `<text x=\"${x}\" y=\"${y}\" font-size=\"${size}\" stroke=\"none\" fill=\"${fill}\" ${extra}>${esc(value)}</text>`;\n\nconst multiline = (x, y, lines, size = 14, fill = \"#666\", gap = 24) =>\n  lines.map((line, index) => text(x, y + index * gap, line, size, fill)).join(\"\\n\");\n\nfunction wrapWords(value, maxCharacters = 48) {\n  const lines = [];\n  let current = \"\";","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/doc/plans/chat-adapters/generate-wireframes.mjs#L179-L215","documentation":"Spec-validation guard in the wireframe generator: every screen definition in uiSurfaceSpec must carry exactly five documented annotations (the viewer renders a numbered annotation list per screen). This sentinel throws during generation when a screen's annotations array is missing, empty, or does not have length 5 — it is an authoring-data error in the script's screen spec, not a runtime condition.","triggerScenarios":"Thrown at doc/plans/chat-adapters/generate-wireframes.mjs:197 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Count the annotations array for the screen named in the message and pad or trim it to exactly five entries.","Check for a recently edited screen spec where annotations were removed or the array was renamed so it resolved to undefined.","Replace an empty annotations array with five meaningful annotation strings covering the screen's key behaviors."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}