{"record":{"id":"6205e8f5b5f9de8d","repo":"abhigyanpatwari/GitNexus","slug":"unknown-key-key-in-gitnexus-rc-filename","errorCode":null,"errorMessage":"Unknown key \"${key}\" in ${GITNEXUS_RC_FILENAME}. ${ALLOWED_KEYS_HINT}","messagePattern":"Unknown key \"(.+?)\" in (.+?)\\. (.+?)","errorType":"validation","errorClass":"GitNexusRcError","httpStatus":null,"severity":"error","filePath":"gitnexus/src/cli/analyze-config.ts","lineNumber":347,"sourceCode":" * 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> => {\n  const out: Partial<AnalyzeOptions> = {};\n  const setBy = new Map<keyof AnalyzeOptions, string>();\n\n  for (const [key, value] of Object.entries(obj)) {\n    if (allowNestedKey && key === NESTED_KEY) continue; // handled separately\n    // `Object.hasOwn`, not a truthiness check: a plain-object lookup like\n    // `KEY_SPECS[\"__proto__\"]` returns an inherited member (Object.prototype,\n    // truthy) and would slip past `if (!spec)`, hitting the wrong error branch\n    // instead of the documented \"Unknown key\" message (#1996 tri-review P3).\n    if (!Object.hasOwn(KEY_SPECS, key)) {\n      throw new GitNexusRcError(\n        `Unknown key \"${key}\" in ${GITNEXUS_RC_FILENAME}. ${ALLOWED_KEYS_HINT}`,\n      );\n    }\n    const spec = KEY_SPECS[key];\n    const prev = setBy.get(spec.target);\n    if (prev && prev !== key) {\n      throw new GitNexusRcError(\n        `${GITNEXUS_RC_FILENAME}: \"${prev}\" and \"${key}\" both configure the same option; set only one.`,\n      );\n    }\n    setBy.set(spec.target, key);\n    (out as Record<string, unknown>)[spec.target] = normalizeValue(spec.kind, value, key);\n  }\n\n  return out;\n};\n\n/**","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/gitnexus/src/cli/analyze-config.ts#L329-L365","documentation":"`.gitnexusrc` contains a top-level (or nested `analyze`) key that is not in the allowed KEY_SPECS set. GitNexus fails closed so a typo like `skipAgentMd` never silently no-ops. The error message appends ALLOWED_KEYS_HINT, which lists every accepted key plus the nested `analyze` object.","triggerScenarios":"A typo such as { \"skipAgentMd\": true } (should be `skipAgentsMd`); a removed/renamed key from an older version; a key belonging to a different tool copy-pasted in.","commonSituations":"Typos after an upgrade; copy-pasting from outdated docs or another repo's config; using a CLI flag name verbatim as a config key when the accepted name differs.","solutions":["Read the allowed-keys list printed in the error message and match one exactly.","Correct the typo or remove the unknown key.","If upgrading, check the changelog for renamed keys (e.g. alias consolidations)."],"exampleFix":"// before\n\"skipAgentMd\": true\n// after\n\"skipAgentsMd\": true","handlingStrategy":"validation","validationCode":"const ALLOWED = ['defaultBranch','branch','skipAgentsMd','skipContextFiles','skipAiContext','skipSkills','pdg','indexOnly','stats','noStats','embeddings','dropEmbeddings','name','allowDuplicateName','maxFileSize','workerTimeout','walCheckpointThreshold','workers','embeddingThreads','embeddingBatchSize','embeddingSubBatchSize','embeddingDevice','fetchWrappers','embeddingBaseUrl','embeddingModel','analyze'];\nfor (const k of Object.keys(cfg)) {\n  if (!ALLOWED.includes(k)) throw new Error('Unknown key: ' + k);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read the allowed-keys hint printed by the error before adding a new key.","After an upgrade, check the changelog for renamed keys.","Lint .gitnexusrc against the allowed set in CI."],"tags":["config","gitnexusrc","validation","unknown-key"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}