{"record":{"id":"4c761cea3890c59a","repo":"affaan-m/ECC","slug":"live-node-qualification-requires-live-sixtytwo-e","errorCode":null,"errorMessage":"Live node qualification requires --live-sixtytwo exactly once before any process is started.","messagePattern":"Live node qualification requires --live-sixtytwo exactly once before any process is started\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/ito.js","lineNumber":113,"sourceCode":"    .filter((index) => index >= 0);\n  if (indexes.length !== 1) {\n    throw new Error(`${option} is required exactly once for live node qualification.`);\n  }\n  const value = args[indexes[0] + 1];\n  if (!value?.trim() || value.startsWith(\"--\")) {\n    throw new Error(`${option} requires a non-empty value for live node qualification.`);\n  }\n  return value;\n}\n\nfunction validateNodeQualificationArgs(args, environment) {\n  if (environment.ITO_ENABLE_SIXTYTWO_LIVE !== \"1\") {\n    throw new Error(\n      \"Live node qualification requires ITO_ENABLE_SIXTYTWO_LIVE=1 before any process is started.\"\n    );\n  }\n  if (args.filter((value) => value === \"--live-sixtytwo\").length !== 1) {\n    throw new Error(\n      \"Live node qualification requires --live-sixtytwo exactly once before any process is started.\"\n    );\n  }\n  requiredOptionValue(args, \"--cluster\");\n  const nodes = requiredOptionValue(args, \"--nodes\");\n  if (!nodes.split(\",\").every((node) => node.trim().length > 0)) {\n    throw new Error(\"--nodes must explicitly list one or more non-empty nodes.\");\n  }\n  const configDirectory = requiredOptionValue(args, \"--config-dir\");\n  if (!path.isAbsolute(configDirectory)) {\n    throw new Error(\"--config-dir must be an existing absolute directory.\");\n  }\n  try {\n    const resolved = fs.realpathSync.native(configDirectory);\n    if (\n      !fs.statSync(resolved).isDirectory()\n      || !fs.statSync(path.join(resolved, \"sixtytwo.yaml\")).isFile()\n    ) {","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/ito.js#L95-L131","documentation":"validateNodeQualificationArgs() requires the --live-sixtytwo flag to appear exactly once as an explicit, deliberate opt-in to live qualification. Zero occurrences means the caller did not request live mode explicitly; duplicates are ambiguous. The check runs before any process is started.","triggerScenarios":"Calling the qualification entry point without --live-sixtytwo (relying on ITO_ENABLE_SIXTYTWO_LIVE alone), or passing --live-sixtytwo twice, so the filter count !== 1.","commonSituations":"Users who set the env var but forget the flag, assuming either alone suffices (both are required); duplicated flag after wrapping/composing commands; scripts appending the flag to a command that already includes it.","solutions":["Add exactly one --live-sixtytwo flag to the command (plus ITO_ENABLE_SIXTYTWO_LIVE=1).","Remove duplicate --live-sixtytwo occurrences, keeping one.","In wrapper scripts, append the flag only if not already present in the argument array."],"exampleFix":"// before\nITO_ENABLE_SIXTYTWO_LIVE=1 ito --cluster prod --nodes node-a\n// after\nITO_ENABLE_SIXTYTWO_LIVE=1 ito --live-sixtytwo --cluster prod --nodes node-a","handlingStrategy":"validation","validationCode":"if (args.filter(a => a === '--live-sixtytwo').length !== 1) { throw new Error('--live-sixtytwo must appear exactly once'); }","typeGuard":null,"tryCatchPattern":"try { runQualification(args); } catch (e) { if (e.message.includes('--live-sixtytwo')) { console.error('Pass --live-sixtytwo exactly once along with ITO_ENABLE_SIXTYTWO_LIVE=1'); process.exit(2); } throw e; }","preventionTips":["Treat --live-sixtytwo and ITO_ENABLE_SIXTYTWO_LIVE=1 as a required pair — both, always.","Deduplicate flags when composing commands from multiple sources.","Keep live qualification commands in a reviewed script rather than typed ad hoc."],"tags":["cli","missing-flag","safety-gate"],"backgroundTag":"missing-required-flag","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}