{"record":{"id":"ab03f8209de987e3","repo":"stablyai/orca","slug":"invalid-scenario-options-scenario","errorCode":null,"errorMessage":"Invalid scenario: ${options.scenario}","messagePattern":"Invalid scenario: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-codex-real-account-validation.mjs","lineNumber":312,"sourceCode":"      options.keep = true\n    } else if (arg === '--lane-aware-containment') {\n      // Why: on Windows the system-default real-home lane cannot be env-sandboxed\n      // (native codex ignores USERPROFILE), so strict zero-event containment is\n      // structurally unreachable there. This mode records codex's designed\n      // volatile churn without aborting while every other real-home write stays\n      // a hard failure. The absolute zero-event claim is carried by macOS runs.\n      options.laneAwareContainment = true\n    } else if (arg === '--help') {\n      console.log(\n        'Usage: node config/scripts/run-codex-real-account-validation.mjs [--scenario mixed|managed-only|codex-lb] [--config-template <path>] [--temp-parent <dir>] [--skip-build] [--dry-run] [--close-after-launch] [--keep] [--lane-aware-containment] [--report <path>]'\n      )\n      process.exit(0)\n    } else {\n      throw new Error(`Unknown argument: ${arg}`)\n    }\n  }\n  if (!VALID_SCENARIOS.has(options.scenario)) {\n    throw new Error(`Invalid scenario: ${options.scenario}`)\n  }\n  if (options.scenario === 'codex-lb' && !options.configTemplate) {\n    throw new Error('The codex-lb scenario requires --config-template outside primary ~/.codex')\n  }\n  return options\n}\n\n// Why: `npx` resolves to a .cmd shim on Windows that execFileSync cannot launch\n// (ENOENT), so the harness could not build its own app there. Run the\n// repository-local electron-vite JS entry with the current Node binary instead;\n// process.execPath + a resolved .js path behaves identically on macOS, Linux,\n// and Windows without a shell.\nexport function resolveElectronViteBuildCommand(repoRoot) {\n  const electronViteEntry = path.join(\n    repoRoot,\n    'node_modules',\n    'electron-vite',\n    'bin',","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-codex-real-account-validation.mjs#L294-L330","documentation":"Thrown by the Codex validation harness after parsing completes when --scenario is not one of {mixed, managed-only, codex-lb}. The VALID_SCENARIOS set is checked post-parse, so the scenario flag must have a value and that value must be in the set.","triggerScenarios":"Passing --scenario=experimental, --scenario=prod, or any value not in the three allowed scenarios. The default is 'mixed' (which is valid), so this only fires when an explicit invalid value is given.","commonSituations":"A developer guesses a scenario name or uses one that was removed/renamed in a refactor.","solutions":["Use one of the three valid scenarios: --scenario mixed, --scenario managed-only, or --scenario codex-lb.","Omit --scenario to use the default 'mixed'."],"exampleFix":"// before\nnode config/scripts/run-codex-real-account-validation.mjs --scenario experimental\n// after\nnode config/scripts/run-codex-real-account-validation.mjs --scenario managed-only","handlingStrategy":"validation","validationCode":"const VALID_SCENARIOS = new Set(['mixed', 'managed-only', 'codex-lb'])\nif (!VALID_SCENARIOS.has(options.scenario)) {\n  throw new Error(`Invalid scenario: ${options.scenario}. Use ${[...VALID_SCENARIOS].join(', ')}.`)\n}","typeGuard":"function isValidScenario(value) {\n  return typeof value === 'string' && new Set(['mixed','managed-only','codex-lb']).has(value)\n}","tryCatchPattern":null,"preventionTips":["Derive the error message from VALID_SCENARIOS so the accepted values are always listed.","Validate the scenario immediately after reading it rather than at the end of parsing."],"tags":["cli","validation","scenario","argument-parsing"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}