{"record":{"id":"c22034f3008d23ea","repo":"affaan-m/ECC","slug":"invalid-repository","errorCode":null,"errorMessage":"invalid repository","messagePattern":"invalid repository","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/discord/announcement-core.mjs","lineNumber":24,"sourceCode":"  return discussion?.category?.name === 'Announcements';\n}\n\nexport function releaseMarker(tag) {\n  const normalized = String(tag || '').trim();\n  if (!normalized) throw new Error('release tag is required');\n  return `<!-- ecc-release:${normalized} -->`;\n}\n\nexport function findReleaseDiscussion(discussions, marker) {\n  return discussions.find(item => (\n    item?.category?.name === 'Announcements'\n    && typeof item.body === 'string'\n    && item.body.includes(marker)\n  )) || null;\n}\n\nexport function announcementKey({ repository, discussionId }) {\n  if (!/^[^/\\s]+\\/[^/\\s]+$/.test(String(repository || ''))) throw new Error('invalid repository');\n  if (!/^[A-Za-z0-9_-]+$/.test(String(discussionId || ''))) throw new Error('invalid discussion id');\n  return `${repository}:discussion:${discussionId}`;\n}\n\nexport function buildDiscordPayload({ title, body, url, key }) {\n  const discussionId = String(key).split(':').at(-1);\n  const footer = `ecc:${discussionId}`;\n  const description = String(body || '').trim().slice(0, DISCORD_DESCRIPTION_LIMIT);\n  const nonce = `ecc-${createHash('sha256').update(String(key)).digest('hex').slice(0, 16)}`;\n  return {\n    allowed_mentions: { parse: [] },\n    nonce,\n    enforce_nonce: true,\n    embeds: [{\n      title: String(title || 'ECC announcement').trim().slice(0, 256),\n      description,\n      url: String(url || ''),\n      footer: { text: footer },","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/scripts/discord/announcement-core.mjs#L6-L42","documentation":"announcementKey validates the repository component of its id: it must match the 'owner/repo' shape (two non-empty, non-space segments). A malformed repository would corrupt the announcement receipt key.","triggerScenarios":"Triggered when announcement-core.mjs rejects the current invocation: invalid repository","commonSituations":"Occurs while running scripts/discord/announcement-core.mjs with invalid arguments, missing flags, or a failing external dependency; the guard at scripts/discord/announcement-core.mjs:24 aborts the command with this message.","solutions":["Correct the value to one of the accepted options listed in the error message."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06c5e118c4d3e6c3b7f9445f973a2194c82de193","analyzedAt":"2026-08-18T11:27:13.915Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}