{"record":{"id":"9a42b0c6bb9d0738","repo":"nexu-io/open-design","slug":"projecttitle-must-be-at-most-256-characters","errorCode":null,"errorMessage":"projectTitle must be at most 256 characters","messagePattern":"projectTitle must be at most 256 characters","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"apps/daemon/src/mcp-brief.ts","lineNumber":640,"sourceCode":"      return optionLabel ? `${questionLabel}: ${optionLabel}` : null;\n    })\n    .filter((line): line is string => Boolean(line));\n  return lines.length > 0 ? lines.join('\\n') : BRIEF_COPY[locale].noDecisions;\n}\n\nexport function localMcpBriefResponseCopy(locale: LocalMcpBriefLocale) {\n  return {\n    completeCard: BRIEF_COPY[locale].completeCard,\n    confirmed: BRIEF_COPY[locale].confirmed,\n    continueWithBrief: BRIEF_COPY[locale].continueWithBrief,\n  };\n}\n\nfunction readProjectTitle(value: unknown): string {\n  if (value === undefined) return 'Untitled Open Design artifact';\n  const title = readRequiredString(value, 'projectTitle').trim();\n  if (title.length > 256) {\n    throw new Error('projectTitle must be at most 256 characters');\n  }\n  return title;\n}\n\nfunction readRequiredString(value: unknown, field: string): string {\n  if (typeof value !== 'string' || value.length === 0) {\n    throw new Error(`${field} must be a non-empty string`);\n  }\n  return value;\n}\n\nfunction readAnswerRecord(value: unknown, field: string): UnknownRecord {\n  if (value === undefined) return {};\n  if (!value || typeof value !== 'object' || Array.isArray(value)) {\n    throw new Error(`${field} must be an object`);\n  }\n  return { ...(value as UnknownRecord) };\n}","sourceCodeStart":622,"sourceCodeEnd":658,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/mcp-brief.ts#L622-L658","documentation":"readProjectTitle trims the supplied projectTitle and throws if it exceeds 256 characters. Omitting projectTitle is allowed (it defaults to 'Untitled Open Design artifact'); only an over-long non-empty string fails.","triggerScenarios":"Passing a title longer than 256 chars after trim; passing a multi-line blob; an LLM dumping a long description into projectTitle.","commonSituations":"User pastes a paragraph as the title; concatenating several fields into projectTitle.","solutions":["Trim the title to at most 256 characters before calling collect_brief.","Pass a short label and put long text in answers, not the title."],"exampleFix":"// before\ncollect_brief({ artifactType: 'website', projectTitle: longParagraph })\n\n// after\ncollect_brief({ artifactType: 'website', projectTitle: longParagraph.slice(0, 256).trim() })","handlingStrategy":"validation","validationCode":"const title = (projectTitle ?? '').toString().trim().slice(0, 256);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cap projectTitle at 256 characters on the client.","Keep the title a short label, not a description.","Omit projectTitle if you have no meaningful label; it has a safe default."],"tags":["mcp","brief","validation"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}