{"record":{"id":"66b2ced91fb20997","repo":"stablyai/orca","slug":"usage-node-config-scripts-release-rc-history-mjs","errorCode":null,"errorMessage":"Usage: node config/scripts/release-rc-history.mjs <base-version>","messagePattern":"Usage: node config/scripts/release-rc-history\\.mjs <base-version>","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/release-rc-history.mjs","lineNumber":78,"sourceCode":"  const logRefs = ['HEAD', 'origin/main'].filter(\n    (ref) => gitLines(['rev-parse', '--verify', '--quiet', ref], cwd).length > 0\n  )\n  if (logRefs.length > 0) {\n    for (const subject of gitLines(['log', '--format=%s', ...logRefs], cwd)) {\n      const rcNumber = rcNumberFromReleaseSubject(base, subject)\n      if (rcNumber !== null) {\n        numbers.push(rcNumber)\n      }\n    }\n  }\n\n  return numbers.length === 0 ? null : Math.max(...numbers)\n}\n\nfunction main() {\n  const base = process.argv[2]\n  if (!base) {\n    throw new Error('Usage: node config/scripts/release-rc-history.mjs <base-version>')\n  }\n\n  const highest = highestRcForBase(base)\n  if (highest !== null) {\n    process.stdout.write(String(highest))\n  }\n}\n\nif (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {\n  try {\n    main()\n  } catch (error) {\n    console.error(error instanceof Error ? error.message : String(error))\n    process.exit(1)\n  }\n}\n","sourceCodeStart":60,"sourceCodeEnd":95,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/release-rc-history.mjs#L60-L95","documentation":"Thrown by main() in config/scripts/release-rc-history.mjs when the script is invoked without a base-version argument. The script computes the highest existing RC number for a given base (e.g. for `1.2.3` it scans `v1.2.3-rc.*` tags and release-commit subjects) and writes it to stdout; with no base there is nothing to scan. main() reads `process.argv[2]` and throws at line 77-78 if it is falsy.","triggerScenarios":"Run `node config/scripts/release-rc-history.mjs` with no positional argument, or invoke it via a wrapper that drops argv[2]. The guard fires before highestRcForBase is called.","commonSituations":"A release workflow step forwards an unset `BASE_VERSION` variable to the script (so argv[2] is undefined), or a developer runs the script manually to inspect RC history without reading its usage. The message doubles as the usage string.","solutions":["Pass the base version as the first positional arg, e.g. `node config/scripts/release-rc-history.mjs 1.2.3`.","In CI, ensure the BASE_VERSION (or equivalent) variable is set and forwarded: `... \"${BASE_VERSION}\"`.","Confirm your wrapper does not swallow argv when delegating to the script."],"exampleFix":"// before\nnode config/scripts/release-rc-history.mjs\n\n// after\nnode config/scripts/release-rc-history.mjs 1.2.3","handlingStrategy":"validation","validationCode":"const base = process.argv[2]\nif (!base || !/^\\d+\\.\\d+\\.\\d+$/.test(base)) {\n  throw new Error('Usage: node config/scripts/release-rc-history.mjs <base-version> (e.g. 1.2.3)')\n}","typeGuard":"function isBaseVersion(value) {\n  return typeof value === 'string' && /^\\d+\\.\\d+\\.\\d+$/.test(value)\n}","tryCatchPattern":null,"preventionTips":["Forward BASE_VERSION explicitly when invoking from CI: `... \"$BASE_VERSION\"`.","Validate argv[2] presence and shape before running.","Treat the script's usage string as the contract: one positional base-version arg."],"tags":["cli","release","args","rc","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}