{"record":{"id":"a65a68ac155d9200","repo":"abhigyanpatwari/GitNexus","slug":"source-must-be-a-finite-number","errorCode":null,"errorMessage":"${source} must be a finite number.","messagePattern":"(.+?) must be a finite number\\.","errorType":"validation","errorClass":"GitNexusRcError","httpStatus":null,"severity":"error","filePath":"gitnexus/src/cli/analyze-config.ts","lineNumber":293,"sourceCode":"          );\n        }\n        names.push(trimmed);\n      }\n      if (names.length === 0) {\n        throw new GitNexusRcError(`${source} must list at least one string.`);\n      }\n      // De-duplicate and cap to a sane bound so a pathological config cannot\n      // blow up the consumer scan's alternation.\n      return Array.from(new Set(names)).slice(0, 100);\n    }\n    case 'numeric-string': {\n      // Mirror Commander's contract: these options reach the existing CLI\n      // validation as strings. Accept a JSON number or a string; normalize to a\n      // string and let the downstream per-flag validation enforce ranges so the\n      // error messages stay in one place.\n      if (typeof value === 'number') {\n        if (!Number.isFinite(value)) {\n          throw new GitNexusRcError(`${source} must be a finite number.`);\n        }\n        return String(value);\n      }\n      if (typeof value === 'string') {\n        const trimmed = value.trim();\n        if (!trimmed) {\n          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) {","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/gitnexus/src/cli/analyze-config.ts#L275-L311","documentation":"A `numeric-string` config key (maxFileSize, workerTimeout, walCheckpointThreshold, workers, embeddingThreads, embeddingBatchSize, embeddingSubBatchSize) received a JSON number that is NaN, Infinity, or -Infinity. These keys forward to Commander's per-flag range validation as strings, so the value must be a finite number before normalization.","triggerScenarios":"A `.gitnexusrc` value that decodes to a non-finite number, e.g. `1e999` (overflows to Infinity in some lenient parsers) or a hand-authored `Infinity` token accepted by a non-strict JSON reader.","commonSituations":"Editing `.gitnexusrc` with a lenient parser that accepts `Infinity`; copy-paste from documentation or a JS source where `Infinity` is valid; generated config from a tool that emits sentinel values.","solutions":["Replace the value with a concrete finite integer, e.g. \"workers\": 8.","Pass the value as a numeric string instead, e.g. \"workers\": \"8\".","Remove the key to accept the built-in default."],"exampleFix":"// before\n\"workers\": Infinity\n// after\n\"workers\": 8","handlingStrategy":"validation","validationCode":"const NUMERIC_KEYS = ['maxFileSize','workerTimeout','walCheckpointThreshold','workers','embeddingThreads','embeddingBatchSize','embeddingSubBatchSize'];\nfor (const k of NUMERIC_KEYS) {\n  const v = cfg[k];\n  if (typeof v === 'number' && !Number.isFinite(v)) {\n    throw new Error(k + ' must be a finite number');\n  }\n}","typeGuard":"const isFiniteNumberOrNumericString = (v) =>\n  (typeof v === 'number' && Number.isFinite(v)) || (typeof v === 'string' && v.trim().length > 0);","tryCatchPattern":null,"preventionTips":["Use concrete integers in .gitnexusrc; avoid Infinity or sentinel values.","Validate numeric keys with a JSON schema (type number) before commit."],"tags":["config","gitnexusrc","validation","numeric"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}