{"record":{"id":"0e909c1e88680507","repo":"affaan-m/ECC","slug":"label-has-too-many-values-maximum-limit","errorCode":null,"errorMessage":"${label} has too many values (maximum ${limit}).","messagePattern":"(.+?) has too many values \\(maximum (.+?)\\)\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/memory-vault-format.js","lineNumber":120,"sourceCode":"    throw new Error(`${label} must be a lowercase letters/numbers slug.`);\n  }\n  return normalized;\n}\n\nfunction validateMemoryId(value) {\n  const normalized = asNonEmptyString(value, 'memory id', 132);\n  if (!MEMORY_ID_PATTERN.test(normalized)) {\n    throw new Error('memory id must match mem_<lowercase-id> and cannot contain a path.');\n  }\n  return normalized;\n}\n\nfunction uniqueStrings(values, { label, limit, validator }) {\n  if (!Array.isArray(values)) {\n    throw new Error(`${label} must be an array.`);\n  }\n  if (values.length > limit) {\n    throw new Error(`${label} has too many values (maximum ${limit}).`);\n  }\n  return values.reduce((result, value) => {\n    const normalized = validator(value);\n    if (result.includes(normalized)) {\n      throw new Error(`${label} must not contain duplicate values.`);\n    }\n    return [...result, normalized];\n  }, []);\n}\n\nfunction validateTimestamp(value, label) {\n  const normalized = asNonEmptyString(value, label, 64);\n  const parsed = new Date(normalized);\n  if (\n    !ISO_TIMESTAMP_PATTERN.test(normalized)\n    || Number.isNaN(parsed.getTime())\n    || parsed.toISOString() !== normalized\n  ) {","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/lib/memory-vault-format.js#L102-L138","documentation":"Thrown by uniqueStrings() when the array length exceeds the per-field limit (e.g. MAX_TAGS=32, MAX_LINKS=64, MAX_TARGETS=32). The limit is the second guard after the type check and prevents runaway documents.","triggerScenarios":"Submitting 33 tags, 65 links, or 33 target harnesses in a single memory document.","commonSituations":"Auto-generated tag lists that explode combinatorially; merging documents without dedup; bulk imports.","solutions":["Reduce the list to within the documented limit (the number is in the error message).","Dedupe and prioritize the most relevant entries.","Split the memory into multiple documents if all entries are genuinely needed."],"exampleFix":"// before\nuniqueStrings(tags.slice(), { label: 'tags', limit: 32, validator: v => v }); // tags.length === 50\n// after\nuniqueStrings(dedupeAndRank(tags).slice(0, 32), { label: 'tags', limit: 32, validator: v => v });","handlingStrategy":"validation","validationCode":"function enforceLimit(values, limit) {\n  if (values.length > limit) {\n    throw new Error(`List exceeds limit of ${limit}; got ${values.length}.`);\n  }\n  return values;\n}","typeGuard":"function isWithinLimit(values, limit) {\n  return Array.isArray(values) && values.length <= limit;\n}","tryCatchPattern":"try {\n  result = uniqueStrings(values, opts);\n} catch (e) {\n  if (/has too many values/.test(e.message)) result = uniqueStrings(values.slice(0, opts.limit), opts);\n  else throw e;\n}","preventionTips":["Cap list inputs at the UI layer to the documented limits.","Dedupe before bulk import to reduce length.","Split overly large memory documents into smaller, focused ones."],"tags":["memory-vault","validation","array","limit"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}