{"record":{"id":"f096361f76403814","repo":"tobi/qmd","slug":"line-line-number-type-must-include-text","errorCode":null,"errorMessage":"Line ${line.number} (${type}:) must include text.","messagePattern":"Line (.+?) \\((.+?):\\) must include text\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/bench/bench.ts","lineNumber":76,"sourceCode":"\n  for (const line of lines) {\n    if (intentRe.test(line.trimmed)) {\n      if (intent !== undefined) {\n        throw new Error(`Line ${line.number}: only one intent: line is allowed per benchmark query.`);\n      }\n      intent = line.trimmed.replace(intentRe, \"\").trim();\n      if (!intent) {\n        throw new Error(`Line ${line.number}: intent: must include text.`);\n      }\n      continue;\n    }\n\n    const match = line.trimmed.match(prefixRe);\n    if (match) {\n      const type = match[1]!.toLowerCase() as \"lex\" | \"vec\" | \"hyde\";\n      const text = line.trimmed.slice(match[0].length).trim();\n      if (!text) {\n        throw new Error(`Line ${line.number} (${type}:) must include text.`);\n      }\n      searches.push({ type, query: text, line: line.number });\n      continue;\n    }\n\n    if (lines.length === 1) {\n      return undefined;\n    }\n\n    throw new Error(`Line ${line.number} is missing a lex:/vec:/hyde:/intent: prefix.`);\n  }\n\n  if (intent && searches.length === 0) {\n    throw new Error(\"intent: cannot appear alone. Add at least one lex:, vec:, or hyde: line.\");\n  }\n\n  return searches.length > 0 ? { searches, intent } : undefined;\n}","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/tobi/qmd/blob/dbfd0b4736aeaf761d1a16ca8e424f071df8feb9/src/bench/bench.ts#L58-L94","documentation":"Thrown by parseStructuredQuery when a line in a bench fixture matches the lex:/vec:/hyde: prefix but carries no query text. Every typed search line must include the actual query string after the prefix.","triggerScenarios":"A fixture query document line like 'vec:' or 'lex:   ' with nothing after the prefix.","commonSituations":"Template fixture files where the query text was never filled in; deleting query text but leaving the prefix skeleton.","solutions":["Add the search text after the prefix (e.g. 'lex: how to install qmd')","Remove the empty line if the search is not needed"],"exampleFix":"// before\n\"lex:\"\n// after\n\"lex: how to install qmd\"","handlingStrategy":"validation","validationCode":"if (/^\\s*(lex|vec|hyde):\\s*$/im.test(doc)) throw new Error('typed line missing query text');","typeGuard":"const noEmptyTypedLine = (doc: string) => !/^\\s*(lex|vec|hyde):\\s*$/im.test(doc);","tryCatchPattern":null,"preventionTips":["Lint fixture documents for empty prefixes before running bench"],"tags":["bench","fixture-validation","query-syntax"],"backgroundTag":"query-syntax-validation-failed","analyzedSha":"dbfd0b4736aeaf761d1a16ca8e424f071df8feb9","analyzedAt":"2026-08-28T18:07:46.628Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}