{"record":{"id":"ae2ee90c13a22633","repo":"stablyai/orca","slug":"unknown-argument-arg","errorCode":null,"errorMessage":"Unknown argument: ${arg}","messagePattern":"Unknown argument: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/hang-watchdog-memory-benchmark.mjs","lineNumber":292,"sourceCode":"  } finally {\n    app.quit()\n    rmSync(profileDir, { recursive: true, force: true })\n  }\n}\n\nfunction parseArgs(argv) {\n  const options = { boundary: '', trials: DEFAULT_TRIALS, output: '' }\n  for (let index = 0; index < argv.length; index += 1) {\n    const arg = argv[index]\n    const value = argv[index + 1]\n    if (arg === '--boundary' || arg === '--trials' || arg === '--output') {\n      if (!value) {\n        throw new Error(`Missing value for ${arg}`)\n      }\n      options[arg.slice(2)] = arg === '--trials' ? Number(value) : value\n      index += 1\n    } else {\n      throw new Error(`Unknown argument: ${arg}`)\n    }\n  }\n  if (!['child', 'worker'].includes(options.boundary)) {\n    throw new Error('--boundary must be child or worker')\n  }\n  if (!Number.isInteger(options.trials) || options.trials < 1) {\n    throw new Error('--trials must be a positive integer')\n  }\n  return options\n}\n\nfunction electronPath() {\n  const requirePath = import.meta.resolve('electron')\n  const electronModulePath = fileURLToPath(requirePath)\n  return execFileSync(\n    process.execPath,\n    ['-e', `process.stdout.write(require(${JSON.stringify(electronModulePath)}))`],\n    {","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/hang-watchdog-memory-benchmark.mjs#L274-L310","documentation":"Thrown by parseArgs for any command-line token that is not one of the recognized flags (--boundary, --trials, --output). The parser is strict: an unknown token is treated as a user error rather than silently ignored.","triggerScenarios":"Passing a typo'd or unsupported flag such as `--boundery child`, `--trial 7`, a bare positional argument, or a flag from an older/newer version of the script.","commonSituations":"Version skew between the script and the invoking docs/workflow, typos, or leftover flags after a refactor renamed an option.","solutions":["Check the script's recognized flags: only --boundary, --trials, and --output are accepted.","Correct typos and remove stray positional arguments.","Update the calling workflow/docs to match the current flag set."],"exampleFix":"// before\nnode ... --boundery child --trail 7\n// after\nnode ... --boundary child --trials 7","handlingStrategy":"validation","validationCode":"const KNOWN_FLAGS = new Set(['--boundary', '--trials', '--output'])\nfor (const a of argv) {\n  if (a.startsWith('--') && !KNOWN_FLAGS.has(a)) throw new Error(`Unknown argument: ${a}`)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep docs and CI workflows in sync with the recognized flag set.","Document the accepted flags in the script header."],"tags":["benchmark","cli","arguments","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}