abhigyanpatwari/GitNexus · error · Error

name is required in group.yaml

Error message

name is required in group.yaml

What it means

Thrown by parseGroupConfig when the 'name' field is missing, falsy, or not a string. The name identifies the group in storage paths and contract registries, so a non-string value is rejected before it can corrupt downstream directory construction.

Source

Thrown at gitnexus/src/core/group/config-parser.ts:57

  bm25_threshold: 0.7,
  embedding_threshold: 0.65,
  max_candidates_per_step: 3,
  exclude_links_paths: [] as string[],
  exclude_links_param_only_paths: false,
};

export function parseGroupConfig(yamlContent: string): GroupConfig {
  const raw = yaml.load(yamlContent, { schema: yaml.JSON_SCHEMA }) as Record<string, unknown>;

  if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {
    throw new Error('Invalid YAML: expected an object');
  }

  if (raw.version === undefined) throw new Error('version is required in group.yaml');
  if (raw.version !== 1) {
    throw new Error(`Unsupported group.yaml version: ${raw.version}. Expected 1.`);
  }
  if (!raw.name || typeof raw.name !== 'string') throw new Error('name is required in group.yaml');
  if (!raw.repos || typeof raw.repos !== 'object' || Array.isArray(raw.repos)) {
    throw new Error('repos is required in group.yaml (must be a mapping)');
  }

  const repos = raw.repos as Record<string, string>;
  const repoPaths = new Set(Object.keys(repos));

  const rawLinks = (raw.links as unknown[]) || [];
  const links: GroupManifestLink[] = rawLinks.map((l: unknown, i: number) => {
    const link = l as Record<string, unknown>;
    if (!link.from || !repoPaths.has(link.from as string)) {
      throw new Error(`links[${i}].from "${link.from}" does not match any repo path in group`);
    }
    if (!link.to || !repoPaths.has(link.to as string)) {
      throw new Error(`links[${i}].to "${link.to}" does not match any repo path in group`);
    }
    if (!VALID_CONTRACT_TYPES.includes(link.type as ContractType)) {
      throw new Error(

View on GitHub (pinned to d540b00184)

Solutions

  1. Add `name: <your-group-name>` as a non-empty string.
  2. Ensure the name also satisfies validateGroupName's regex (storage.ts: /^[a-zA-Z0-9][a-zA-Z0-9_-]*$/) to avoid a later failure when the directory is created.

Example fix

# before
version: 1
repos: {}

# after
version: 1
name: my-service-group
repos: {}
Defensive patterns

Strategy: validation

Validate before calling

const raw = yaml.load(text, { schema: yaml.JSON_SCHEMA }) as Record<string, unknown>;
if (typeof raw.name !== 'string' || raw.name.length === 0) {
  throw new Error('group.yaml requires a non-empty string name');
}

Type guard

function hasValidGroupName(raw: Record<string, unknown>): raw is { name: string } & Record<string, unknown> {
  return typeof raw.name === 'string' && raw.name.length > 0;
}

Prevention

When it happens

Trigger: group.yaml with no 'name' key; name set to null, an empty string, a number, or a boolean; a YAML parsing quirk where name is interpreted as a non-string type.

Common situations: Template left with name unset; name accidentally deleted during edit; name set to a numeric or boolean value (e.g. `name: 123`).

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12). Data as JSON: /api/errors/35b118408052e63b. Report an issue: GitHub.