{"record":{"id":"011a4ff88a472a56","repo":"stablyai/orca","slug":"boundary-must-be-child-or-worker","errorCode":null,"errorMessage":"--boundary must be child or worker","messagePattern":"--boundary must be child or worker","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/hang-watchdog-memory-benchmark.mjs","lineNumber":296,"sourceCode":"}\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    {\n      encoding: 'utf8'\n    }\n  )\n}","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/hang-watchdog-memory-benchmark.mjs#L278-L314","documentation":"Thrown by parseArgs after parsing completes if options.boundary is not 'child' or 'worker'. This catches a missing --boundary entirely (defaults to empty string '') or a misspelled boundary value that passed the per-token parser.","triggerScenarios":"Omitting --boundary entirely, or passing `--boundary process` / `--boundary main` / any string outside the allowlist.","commonSituations":"Forgetting the flag in a new CI job, copy-pasting an outdated command, or assuming a default boundary exists (there is none).","solutions":["Always pass `--boundary child` or `--boundary worker`.","Add the flag to the CI workflow template so it is never omitted."],"exampleFix":"// before\nnode config/scripts/hang-watchdog-memory-benchmark.mjs --trials 7\n// after\nnode config/scripts/hang-watchdog-memory-benchmark.mjs --boundary worker --trials 7","handlingStrategy":"validation","validationCode":"const boundary = options.boundary\nif (boundary !== 'child' && boundary !== 'worker') {\n  throw new Error(`--boundary must be child or worker, got: ${boundary}`)\n}","typeGuard":"const isSupportedBoundary = (v: unknown): v is 'child' | 'worker' => v === 'child' || v === 'worker'","tryCatchPattern":null,"preventionTips":["Make --boundary a required argument in CI templates so it is never omitted.","Treat the absence of a default as intentional — always pass the flag explicitly."],"tags":["benchmark","cli","arguments","boundary","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}