{"record":{"id":"37b8e40f945b7266","repo":"abhigyanpatwari/GitNexus","slug":"version-is-required-in-group-yaml","errorCode":null,"errorMessage":"version is required in group.yaml","messagePattern":"version is required in group\\.yaml","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/group/config-parser.ts","lineNumber":53,"sourceCode":"  workspace_deps: false,\n};\n\nconst DEFAULT_MATCHING = {\n  bm25_threshold: 0.7,\n  embedding_threshold: 0.65,\n  max_candidates_per_step: 3,\n  exclude_links_paths: [] as string[],\n  exclude_links_param_only_paths: false,\n};\n\nexport function parseGroupConfig(yamlContent: string): GroupConfig {\n  const raw = yaml.load(yamlContent, { schema: yaml.JSON_SCHEMA }) as Record<string, unknown>;\n\n  if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {\n    throw new Error('Invalid YAML: expected an object');\n  }\n\n  if (raw.version === undefined) throw new Error('version is required in group.yaml');\n  if (raw.version !== 1) {\n    throw new Error(`Unsupported group.yaml version: ${raw.version}. Expected 1.`);\n  }\n  if (!raw.name || typeof raw.name !== 'string') throw new Error('name is required in group.yaml');\n  if (!raw.repos || typeof raw.repos !== 'object' || Array.isArray(raw.repos)) {\n    throw new Error('repos is required in group.yaml (must be a mapping)');\n  }\n\n  const repos = raw.repos as Record<string, string>;\n  const repoPaths = new Set(Object.keys(repos));\n\n  const rawLinks = (raw.links as unknown[]) || [];\n  const links: GroupManifestLink[] = rawLinks.map((l: unknown, i: number) => {\n    const link = l as Record<string, unknown>;\n    if (!link.from || !repoPaths.has(link.from as string)) {\n      throw new Error(`links[${i}].from \"${link.from}\" does not match any repo path in group`);\n    }\n    if (!link.to || !repoPaths.has(link.to as string)) {","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/gitnexus/src/core/group/config-parser.ts#L35-L71","documentation":"Thrown by parseGroupConfig when the parsed YAML object has no 'version' key. Version is mandatory because the parser is version-gated (it only accepts version 1) and future manifest formats will branch on this field. The check fires before name/repos validation.","triggerScenarios":"A group.yaml mapping that omits the top-level 'version' key entirely, or where the key is misspelled (e.g. 'Version', 'schemaVersion').","commonSituations":"Hand-authored group.yaml that skipped the version field; a manifest copied from an example that omitted it; a typo in the key name.","solutions":["Add `version: 1` as the first key of group.yaml.","If unsure of the full schema, regenerate the manifest with createGroupDir which writes the correct template, then merge in your values."],"exampleFix":"# before\nname: mygroup\nrepos: {}\n\n# after\nversion: 1\nname: mygroup\nrepos: {}","handlingStrategy":"validation","validationCode":"function hasVersion1(raw: Record<string, unknown>): boolean {\n  return raw.version === 1;\n}\nconst raw = yaml.load(text, { schema: yaml.JSON_SCHEMA }) as Record<string, unknown>;\nif (raw.version === undefined) throw new Error('add version: 1 to group.yaml');","typeGuard":"function hasVersion(v: unknown): v is number { return typeof v === 'number'; }","tryCatchPattern":null,"preventionTips":["Treat `version: 1` as the first line of every group.yaml.","Generate new manifests from the createGroupDir template so version is always present.","Add a CI lint rule that rejects group.yaml files missing a top-level version key."],"tags":["yaml","group-config","validation","config-parser"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}