{"record":{"id":"7b0750425febf4b0","repo":"stablyai/orca","slug":"baseline-requires-a-path","errorCode":null,"errorMessage":"--baseline requires a path","messagePattern":"--baseline requires a path","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 (compare-benchmark-artifacts.mjs:64-69) when --baseline is immediately followed by a missing argument or by another flag (a token starting with '--'). The flag consumes its value via readRequiredValue(args, ++index, ...), so a null or flag-like next token means no path was given.","triggerScenarios":"Passing '--baseline' as the last argument; passing '--baseline --candidate ...' (baseline value omitted); passing '--baseline --title foo' where the next token is another flag.","commonSituations":"Typing the command and accidentally dropping the path; a shell variable expanding to empty (e.g. --baseline $BASELINE_PATH with BASELINE_PATH unset); flag-ordering mistakes in a generated command line.","solutions":["Provide a real path token after --baseline that does not start with '--'.","Ensure any shell variable used for the path is set and non-empty: --baseline \"${BASELINE_PATH:?missing}\".","Quote paths so spaces or special characters do not split the token."],"exampleFix":"// before\nparseBenchmarkComparisonArgs(['--baseline', '--candidate', 'c.json'])\n// after\nparseBenchmarkComparisonArgs(['--baseline', 'b.json', '--candidate', 'c.json'])","handlingStrategy":"validation","validationCode":"function hasValueAfter(argv, flag) {\n  const i = argv.indexOf(flag)\n  return i !== -1 && i + 1 < argv.length && !argv[i + 1].startsWith('--')\n}\nif (!hasValueAfter(argv, '--baseline')) throw new Error('--baseline needs a path')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When building argv from shell variables, use `${VAR:?missing}` to fail on empty values.","Quote all path arguments to survive spaces and dashes."],"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"}