{"record":{"id":"88a90b65631558a4","repo":"abhigyanpatwari/GitNexus","slug":"source-must-be-a-boolean-or-a-non-negative-inte","errorCode":null,"errorMessage":"${source} must be a boolean or a non-negative integer (node cap; 0 disables the cap).","messagePattern":"(.+?) must be a boolean or a non-negative integer \\(node cap; 0 disables the cap\\)\\.","errorType":"validation","errorClass":"GitNexusRcError","httpStatus":null,"severity":"error","filePath":"gitnexus/src/cli/analyze-config.ts","lineNumber":318,"sourceCode":"          throw new GitNexusRcError(`${source} must not be empty.`);\n        }\n        return trimmed;\n      }\n      throw new GitNexusRcError(`${source} must be a number or numeric string.`);\n    }\n    case 'embeddings': {\n      // Mirror `--embeddings [limit]`: boolean toggles, a non-negative integer\n      // sets the node cap (normalized to a string, as Commander would supply).\n      if (typeof value === 'boolean') return value;\n      if (typeof value === 'number') {\n        if (!Number.isInteger(value) || value < 0) {\n          throw new GitNexusRcError(\n            `${source} must be true/false or a non-negative integer (node cap; 0 disables the cap).`,\n          );\n        }\n        return String(value);\n      }\n      throw new GitNexusRcError(\n        `${source} must be a boolean or a non-negative integer (node cap; 0 disables the cap).`,\n      );\n    }\n    default:\n      // Exhaustive — kept for forward-compat if a new kind is added.\n      throw new GitNexusRcError(`${source}: unsupported config value kind.`);\n  }\n};\n\n/**\n * Normalize one level (flat top-level or the nested `analyze` block) into a\n * partial `AnalyzeOptions`. Rejects unknown keys and two aliases that configure\n * the same option at the same level.\n */\nconst normalizeLevel = (\n  obj: Record<string, unknown>,\n  { allowNestedKey }: { allowNestedKey: boolean },\n): Partial<AnalyzeOptions> => {","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/gitnexus/src/cli/analyze-config.ts#L300-L336","documentation":"The `embeddings` config key got a value whose JSON type is neither boolean nor number — e.g. a string, null, object, or array. Unlike the `numeric-string` keys, `embeddings` does NOT accept numeric strings; it mirrors Commander's optional `[limit]` shape which is boolean or integer only.","triggerScenarios":"Setting { \"embeddings\": \"100\" } (string), { \"embeddings\": null }, or { \"embeddings\": [] } in `.gitnexusrc`.","commonSituations":"Assuming `embeddings` accepts a string limit like the workers/maxFileSize keys; quoting the integer out of habit; setting null to clear.","solutions":["Pass a JSON boolean or a JSON number (non-negative integer).","Remove the key to use the default."],"exampleFix":"// before\n\"embeddings\": \"100\"\n// after\n\"embeddings\": 100","handlingStrategy":"type-guard","validationCode":"const v = cfg.embeddings;\nif (v !== undefined && typeof v !== 'boolean' && typeof v !== 'number') {\n  throw new Error('embeddings must be a boolean or a non-negative integer');\n}","typeGuard":"const isEmbeddingsInput = (v) =>\n  v === undefined || typeof v === 'boolean' || typeof v === 'number';","tryCatchPattern":null,"preventionTips":["embeddings does NOT accept numeric strings unlike workers/maxFileSize.","Pass a JSON boolean or a JSON integer."],"tags":["config","gitnexusrc","validation","embeddings"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}