{"record":{"id":"8e120f2d5e2da726","repo":"tobi/qmd","slug":"line-line-number-is-missing-a-lex-vec-hyde-i","errorCode":null,"errorMessage":"Line ${line.number} is missing a lex:/vec:/hyde:/intent: prefix.","messagePattern":"Line (.+?) is missing a lex:/vec:/hyde:/intent: prefix\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/bench/bench.ts","lineNumber":86,"sourceCode":"      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}\n\nfunction uniqueFiles(files: string[], limit: number): string[] {\n  const seen = new Set<string>();\n  const out: string[] = [];\n  for (const file of files) {\n    if (seen.has(file)) continue;\n    seen.add(file);\n    out.push(file);\n    if (out.length >= limit) break;\n  }","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/tobi/qmd/blob/dbfd0b4736aeaf761d1a16ca8e424f071df8feb9/src/bench/bench.ts#L68-L104","documentation":"Thrown when a line in a multi-line bench fixture query lacks any recognized prefix (lex:, vec:, hyde:, intent:). Single-line documents fall through and return undefined (treated as a plain query), but once there are multiple lines every line must be prefixed.","triggerScenarios":"A fixture query like 'lex: install\\nhow do I configure it' — the second line has no prefix and the document has more than one line.","commonSituations":"Appending a follow-up sentence to a typed query; forgetting to prefix an added search line; mixing prose and structured lines.","solutions":["Prefix the offending line with lex:, vec:, or hyde:","Or remove the prose line so the query is a single unprefixed line"],"exampleFix":"// before\n\"lex: install\\nhow do I configure it\"\n// after\n\"lex: install\\nlex: how do I configure it\"","handlingStrategy":"validation","validationCode":"const lines = doc.split('\\n').filter(l => l.trim());\nif (lines.length > 1) {\n  for (const l of lines) if (!/^\\s*(lex|vec|hyde|intent):/i.test(l)) throw new Error(`unprefixed line: ${l}`);\n}","typeGuard":"const allLinesPrefixed = (doc: string) => doc.split('\\n').every(l => !l.trim() || l.length === 1 || /^\\s*(lex|vec|hyde|intent):/i.test(l) || doc.split('\\n').filter(x=>x.trim()).length === 1);","tryCatchPattern":null,"preventionTips":["Remember: single-line documents may be unprefixed; multi-line documents must prefix every line"],"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"}