{"record":{"id":"eac1b8f2ed551ffd","repo":"paperclipai/paperclip","slug":"name-must-be-a-positive-number","errorCode":null,"errorMessage":"${name} must be a positive number.","messagePattern":"(.+?) must be a positive number\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/plugin-llm-wiki/src/wiki/core.ts","lineNumber":487,"sourceCode":"    space,\n    profile,\n    purpose,\n    requireEnabledProfile: options.requireEnabledProfile,\n  });\n  if (!decision.allowed) throw new Error(decision.message);\n  return decision.space;\n}\n\nfunction assertPaperclipSourceScopePayload(input: { projectId?: string | null; rootIssueId?: string | null }) {\n  if (input.projectId && input.rootIssueId) {\n    throw new Error(\"Paperclip source scope must specify either projectId or rootIssueId, not both.\");\n  }\n}\n\nfunction assertRequestedCharacterLimit(name: string, value: unknown, max: number) {\n  if (value == null) return;\n  if (typeof value !== \"number\" || !Number.isFinite(value) || value < 1) {\n    throw new Error(`${name} must be a positive number.`);\n  }\n  if (Math.floor(value) > max) {\n    throw new Error(`${name} exceeds the hard Paperclip ingestion cap of ${max} characters.`);\n  }\n}\n\nfunction stableSpaceId(input: { companyId: string; wikiId: string; slug: string }): string {\n  const hex = createHash(\"md5\")\n    .update(`${input.companyId}:${input.wikiId}:${input.slug}`)\n    .digest(\"hex\");\n  return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-4${hex.slice(13, 16)}-8${hex.slice(17, 20)}-${hex.slice(20, 32)}`;\n}\n\nfunction normalizeLimit(value: unknown, fallback: number, max: number): number {\n  if (typeof value !== \"number\" || !Number.isFinite(value)) return fallback;\n  return Math.max(1, Math.min(max, Math.floor(value)));\n}\n","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/paperclipai/paperclip/blob/5716fe907e596ce73501408fc6efdb19fb61edf2/packages/plugins/plugin-llm-wiki/src/wiki/core.ts#L469-L505","documentation":"Error \"${name} must be a positive number.\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/plugins/plugin-llm-wiki/src/wiki/core.ts:488 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a positive number for the named parameter."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5716fe907e596ce73501408fc6efdb19fb61edf2","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}