{"record":{"id":"81a53e5d4cc24bd1","repo":"stablyai/orca","slug":"release-requires-a-version-argument-e-g-rele","errorCode":null,"errorMessage":"--release requires a version argument, e.g. --release 1.4.160","messagePattern":"--release requires a version argument, e\\.g\\. --release 1\\.4\\.160","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/generate-skill-bundle-manifest.mjs","lineNumber":653,"sourceCode":"      stale.push(filePath)\n    }\n  }\n  if (stale.length > 0) {\n    throw new Error(\n      `Generated skill artifacts are stale:\\n${stale\n        .map((filePath) => path.relative(REPO_ROOT, filePath))\n        .join('\\n')}\\nRun pnpm generate:skill-bundle-manifest.`\n    )\n  }\n}\n\nasync function main() {\n  const argv = process.argv.slice(2)\n  const rebuildFromTags = argv.includes('--rebuild-from-tags')\n  const releaseIndex = argv.indexOf('--release')\n  const releaseVersion = releaseIndex !== -1 ? argv[releaseIndex + 1] : null\n  if (releaseIndex !== -1 && !releaseVersion) {\n    throw new Error('--release requires a version argument, e.g. --release 1.4.160')\n  }\n\n  const committedRegistry = await readCommittedRegistry()\n  const committedMapping = await readCommittedReleaseMapping()\n  const releasedHistory = rebuildFromTags\n    ? releasedHistoryFromTags()\n    : releasedHistoryFromCommitted(committedRegistry, committedMapping)\n  const artifacts = await buildArtifacts(releasedHistory)\n\n  if (releaseVersion) {\n    // Why: the row names revisions the committed registry must already contain,\n    // so proving those artifacts match this ref is what lets the cut record\n    // provenance without regenerating them. If regeneration disagrees with what\n    // is committed, the row would name a revision this tag does not ship.\n    await verifyArtifacts(artifacts, CONTENT_ADDRESSED_PATHS)\n    appendReleaseRow(artifacts, releaseVersion)\n  }\n","sourceCodeStart":635,"sourceCodeEnd":671,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/generate-skill-bundle-manifest.mjs#L635-L671","documentation":"Thrown by main() when the --release flag is present in argv but is the last token, so argv[releaseIndex + 1] is undefined/null. --release must be followed by a version string used to append/overwrite a release-mapping row (generate-skill-bundle-manifest.mjs:647-654).","triggerScenarios":"Running `pnpm generate:skill-bundle-manifest --release` with no version; a trailing --release after a copy-paste trim; a script that appends --release conditionally but drops the version.","commonSituations":"A release-cut wrapper that builds the flag list dynamically and the version variable was empty; manual invocation during release prep forgetting the version; an argument parser that strips the value.","solutions":["Provide a version after --release, e.g. --release 1.4.160.","In wrapper scripts, only append --release when the version variable is non-empty.","Validate that the version matches the expected semver shape before invoking."],"exampleFix":"# before\npnpm generate:skill-bundle-manifest --release\n# after\npnpm generate:skill-bundle-manifest --release 1.4.160","handlingStrategy":"validation","validationCode":"const argv = process.argv.slice(2)\nconst i = argv.indexOf('--release')\nif (i !== -1 && (i + 1 >= argv.length || !/^\\d/.test(argv[i + 1]))) {\n  throw new Error('--release requires a version, e.g. --release 1.4.160')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only append --release when the version variable is non-empty.","Validate the version is semver-like before passing it."],"tags":["cli","argument-validation","release","skills"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}