{"record":{"id":"8f766d1e30df9108","repo":"stablyai/orca","slug":"candidate-requires-a-path","errorCode":null,"errorMessage":"--candidate requires a path","messagePattern":"--candidate 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 --candidate is followed by a null or flag-like token. Identical guard shape to the baseline case: the flag does ++index then readRequiredValue rejects a missing/flag value at compare-benchmark-artifacts.mjs:64-69.","triggerScenarios":"Passing '--candidate' last; passing '--candidate --output report.md'; a shell expansion producing an empty candidate path.","commonSituations":"CI matrix where the candidate artifact path is computed but the job produces none; misordered flags; unquoted path with a leading dash.","solutions":["Supply a real, non-flag path token immediately after --candidate.","Guard the shell variable: --candidate \"${CANDIDATE_PATH:?missing}\".","Confirm the candidate artifact file exists at that path before invoking."],"exampleFix":"// before\nparseBenchmarkComparisonArgs(['--baseline', 'b.json', '--candidate', '--output', 'r.md'])\n// after\nparseBenchmarkComparisonArgs(['--baseline', 'b.json', '--candidate', 'c.json', '--output', 'r.md'])","handlingStrategy":"validation","validationCode":"const i = argv.indexOf('--candidate')\nif (i !== -1 && (i + 1 >= argv.length || argv[i + 1].startsWith('--'))) {\n  throw new Error('--candidate needs a path')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm the candidate artifact file exists and is readable before invoking.","Use shell parameter guards for path variables."],"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"}