{"record":{"id":"6ae9c6c3b88f343e","repo":"JuliusBrussee/caveman","slug":"label-lineno-unexpected-sequence-item-at-ro","errorCode":null,"errorMessage":"${label}:${lineNo}: unexpected sequence item at row level","messagePattern":"(.+?):(.+?): unexpected sequence item at row level","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/generate-agent-catalog.mjs","lineNumber":72,"sourceCode":"    const lineNo = index + 1;\n    if (line === \"\" || /^ *#/.test(line)) continue;\n    const shape = /^( *)(- )?(.*)$/.exec(line);\n    const indent = shape[1].length;\n    const dash = shape[2] !== undefined;\n    const rest = shape[3];\n    if (indent === 0) {\n      if (!dash) throw new Error(`${label}:${lineNo}: expected a top-level \"- provider: ...\" row`);\n      row = {};\n      rows.push(row);\n      blockKey = null;\n      const entry = splitKeyValue(rest, label, lineNo);\n      if (entry.value === undefined) throw new Error(`${label}:${lineNo}: row must start with an inline \"provider\" value`);\n      row[entry.key] = entry.value;\n      continue;\n    }\n    if (row === null) throw new Error(`${label}:${lineNo}: indented line before any row`);\n    if (indent === 2) {\n      if (dash) throw new Error(`${label}:${lineNo}: unexpected sequence item at row level`);\n      const entry = splitKeyValue(rest, label, lineNo);\n      if (Object.prototype.hasOwnProperty.call(row, entry.key)) {\n        throw new Error(`${label}:${lineNo}: duplicate key \"${entry.key}\"`);\n      }\n      if (entry.value === undefined) {\n        blockKey = entry.key;\n        row[entry.key] = undefined;\n      } else {\n        blockKey = null;\n        row[entry.key] = entry.value;\n      }\n      continue;\n    }\n    if (indent === 4) {\n      if (blockKey === null) throw new Error(`${label}:${lineNo}: nested line without an open block`);\n      if (dash) {\n        if (row[blockKey] === undefined) row[blockKey] = [];\n        if (!Array.isArray(row[blockKey])) throw new Error(`${label}:${lineNo}: \"${blockKey}\" mixes map and sequence entries`);","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/scripts/generate-agent-catalog.mjs#L54-L90","documentation":"Thrown by the catalog parser when a line at indent 2 (the row's property level) starts with \"- \". Indent-2 lines must be \"key: value\" properties of the current row; sequences are only allowed one level deeper (indent 4) under an open block key. This keeps the parser's two-level model unambiguous.","triggerScenarios":"Trying to put a list directly at row level, e.g. \"- provider: x\" followed by \"  - item\" instead of \"  key:\" followed by \"    - item\"; or re-indenting nested list items from 4 to 2 spaces.","commonSituations":"Hand-writing YAML following generic examples where lists sit directly under the parent; editor auto-dedent when typing nested dashes; copying a nested block but losing one level of indentation.","solutions":["Introduce a key for the list at indent 2 and move items to indent 4: \"  models:\" then \"    - claude-4\".","Fix indentation: any dash-item under a row property must be exactly 4 spaces in."],"exampleFix":"# before\n- provider: anthropic\n  - claude-4\n\n# after\n- provider: anthropic\n  models:\n    - claude-4","handlingStrategy":"validation","validationCode":"function noSequencesAtRowLevel(text) {\n  return !/^ {2}- /.test(text); // any 2-space dash line is invalid\n}","typeGuard":null,"tryCatchPattern":"try {\n  parseCatalog(text);\n} catch (err) {\n  if (/unexpected sequence item at row level/.test(err.message)) {\n    // introduce a block key at indent 2 and move items to indent 4\n  } else throw err;\n}","preventionTips":["Lists always live under a named key: 2-space key, 4-space dash items.","Match an existing provider row's shape when adding new entries."],"tags":["yaml","parser","indentation","code-generation"],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}