{"record":{"id":"e959eb573bb81638","repo":"stablyai/orca","slug":"output-requires-a-path","errorCode":null,"errorMessage":"--output requires a path","messagePattern":"--output 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 when --output is followed by a null or flag-like token. --output controls the markdown output file path and, when present, must take a value (compare-benchmark-artifacts.mjs:32-34, 64-69).","triggerScenarios":"Passing '--output' last; passing '--output --json-output j.json'; an empty shell variable for the output path.","commonSituations":"CI step that computes an output dir but the variable is unset on some runners; misordered optional flags; trailing flag after a copy-paste trim.","solutions":["Provide a writable file path token after --output, or remove the flag to print markdown to stdout only.","Ensure the output directory is writable; the script does mkdirSync(dirname(...), {recursive:true}) but the path itself must be a valid string."],"exampleFix":"// before\nrunBenchmarkComparisonCli({ argv: ['--baseline','b.json','--candidate','c.json','--output'] })\n// after\nrunBenchmarkComparisonCli({ argv: ['--baseline','b.json','--candidate','c.json','--output','reports/cmp.md'] })","handlingStrategy":"validation","validationCode":"const i = argv.indexOf('--output')\nif (i !== -1 && (i + 1 >= argv.length || argv[i + 1].startsWith('--'))) {\n  throw new Error('--output needs a path')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compute the output directory in CI and fail the job early if unset.","Omit --output entirely to write markdown to stdout when no file is needed."],"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"}