{"record":{"id":"1b47165caf8016e8","repo":"stablyai/orca","slug":"title-requires-a-value","errorCode":null,"errorMessage":"--title requires a value","messagePattern":"--title requires a value","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/compare-benchmark-artifacts.mjs","lineNumber":67,"sourceCode":"      }\n      continue\n    }\n    throw new Error(USAGE)\n  }\n\n  if (!parsed.baselinePath) {\n    throw new Error(USAGE)\n  }\n  if (!parsed.candidatePath) {\n    throw new Error(USAGE)\n  }\n  return parsed\n}\n\nfunction readRequiredValue(args, index, message) {\n  const value = args[index]\n  if (value == null || value.startsWith('--')) {\n    throw new Error(message)\n  }\n  return value\n}\n\nexport function readBenchmarkArtifact(path) {\n  return JSON.parse(readFileSync(path, 'utf8'))\n}\n\nexport function normalizeBenchmarkArtifact(path, artifact = readBenchmarkArtifact(path)) {\n  if (artifact?.summaryMedianMs != null) {\n    return normalizeNumericObject(path, artifact, 'startup', artifact.summaryMedianMs, () => 'ms')\n  }\n  if (artifact?.summaryMedian != null) {\n    return normalizeNumericObject(path, artifact, 'daemon', artifact.summaryMedian, (key) =>\n      key.endsWith('Count') || key.endsWith('After') ? 'count' : 'ms'\n    )\n  }\n  if (artifact?.suites != null) {","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/compare-benchmark-artifacts.mjs#L49-L85","documentation":"Thrown by readRequiredValue when --title is followed by a null or flag-like token. --title is optional but, when present, must take a value; the same ++index/readRequiredValue guard applies (compare-benchmark-artifacts.mjs:28-30, 64-69).","triggerScenarios":"Passing '--title' as the final token; passing '--title --output report.md' (value omitted); passing '--title --higher-is-better key'.","commonSituations":"A wrapper script that conditionally adds --title but drops the value; accidental truncation of a long command line; copy-paste that loses the title argument.","solutions":["Provide a non-flag value token after --title, or remove the --title flag entirely to use the default 'Benchmark comparison'.","If the title comes from a variable, ensure it is set and non-empty before building argv."],"exampleFix":"// before\nparseBenchmarkComparisonArgs(['--baseline', 'b.json', '--candidate', 'c.json', '--title'])\n// after\nparseBenchmarkComparisonArgs(['--baseline', 'b.json', '--candidate', 'c.json', '--title', 'PR #123'])","handlingStrategy":"validation","validationCode":"const i = argv.indexOf('--title')\nif (i !== -1 && (i + 1 >= argv.length || argv[i + 1].startsWith('--'))) {\n  // either supply a value or drop the flag\n  argv.splice(i, 1)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only append --title when the title string is non-empty.","Treat --title as optional and omit it rather than passing it bare."],"tags":["cli","argument-validation","benchmark"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}