{"record":{"id":"b5a9eaca56197148","repo":"abhigyanpatwari/GitNexus","slug":"source-must-not-be-empty","errorCode":null,"errorMessage":"${source} must not be empty.","messagePattern":"(.+?) must not be empty\\.","errorType":"validation","errorClass":"GitNexusRcError","httpStatus":null,"severity":"error","filePath":"gitnexus/src/cli/analyze-config.ts","lineNumber":234,"sourceCode":"      }\n      return value;\n    case 'boolean-negate':\n      if (typeof value !== 'boolean') {\n        throw new GitNexusRcError(`${source} must be a boolean (true/false).`);\n      }\n      return !value;\n    case 'branch':\n      if (typeof value !== 'string') {\n        throw new GitNexusRcError(`${source} must be a string branch name.`);\n      }\n      return validateBranchName(value, source);\n    case 'string': {\n      if (typeof value !== 'string') {\n        throw new GitNexusRcError(`${source} must be a string.`);\n      }\n      const trimmed = value.trim();\n      if (!trimmed) {\n        throw new GitNexusRcError(`${source} must not be empty.`);\n      }\n      assertNoHiddenChars(trimmed, source);\n      // `name` flows into the generated AGENTS.md/CLAUDE.md as `**${name}**` and\n      // inside `gitnexus://repo/${name}/…` code spans, so a Markdown-significant\n      // character would break those spans or inject emphasis/links/HTML into\n      // agent-instruction content (#1996 tri-review P1). `_` is intentionally\n      // allowed (legitimate in repo names; intraword `_` is not emphasis).\n      // embeddingDevice (the other `string`-kind option) only ever holds a\n      // fixed device token, so this guard never rejects a valid value there.\n      if (/[`*[\\]<>]/.test(trimmed)) {\n        throw new GitNexusRcError(\n          `${source} must not contain Markdown-significant characters (\\` * [ ] < >).`,\n        );\n      }\n      return trimmed;\n    }\n    case 'string-array': {\n      // Generic shared validator — `source` already names the config key, so","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/gitnexus/src/cli/analyze-config.ts#L216-L252","documentation":"Thrown by normalizeValue() in the 'string' case when the value is a string but trims to empty. Repo names and embedding URLs flow into generated content and downstream config, so an empty value would produce broken output (e.g. an empty **${name}** in AGENTS.md).","triggerScenarios":"Setting \"name\": \"\", \"name\": \"   \", \"embeddingBaseUrl\": \"  \", or \"embeddingModel\": \"\" in .gitnexusrc.","commonSituations":"A config template with an empty placeholder; clearing a value by setting it to empty rather than removing the key; a whitespace-only value from a copy-paste.","solutions":["Provide a non-empty, non-whitespace value.","Remove the key entirely to accept the default behavior.","Trim surrounding whitespace in the source value before committing."],"exampleFix":"// before\n{ \"name\": \"   \" }\n\n// after\n{ \"name\": \"my-repo\" }","handlingStrategy":"validation","validationCode":"function assertNonEmptyString(value: unknown, key: string): void {\n  if (typeof value !== 'string' || value.trim() === '') {\n    throw new Error(`${key} must not be empty`);\n  }\n}","typeGuard":"function isNonEmptyConfigString(value: unknown): value is string {\n  return typeof value === 'string' && value.trim().length > 0;\n}","tryCatchPattern":null,"preventionTips":["Remove the config key rather than leaving it as an empty string.","Fill template placeholders before committing .gitnexusrc.","Trim values at the source rather than relying on whitespace-only entries."],"tags":["validation","config"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}