{"record":{"id":"1d89c7a7b6e029e2","repo":"stablyai/orca","slug":"report-requires-a-file-path","errorCode":null,"errorMessage":"--report requires a file path.","messagePattern":"--report requires a file path\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/repro-windows-apphang-terminal-activation.mjs","lineNumber":81,"sourceCode":"    if (name === '--gpu') {\n      const modes = (value ?? '')\n        .split(',')\n        .map((entry) => entry.trim())\n        .filter(Boolean)\n      if (modes.length === 0 || modes.some((mode) => !['on', 'off', 'auto'].includes(mode))) {\n        throw new Error(`Unsupported --gpu=${value}. Use on, off, auto, or a comma-list.`)\n      }\n      args.gpuModes = modes\n      continue\n    }\n    if (name === '--output-lines') {\n      args.outputLines = parsePositiveInt(name, value)\n      continue\n    }\n    if (name === '--report') {\n      args.reportPath = value?.trim() || null\n      if (!args.reportPath) {\n        throw new Error('--report requires a file path.')\n      }\n      continue\n    }\n    throw new Error(`Unknown argument: ${arg}`)\n  }\n\n  return args\n}\n\nfunction printHelp() {\n  console.log(`Usage:\n  node config/scripts/repro-windows-apphang-terminal-activation.mjs [options]\n\nOptions:\n  --expect=none|repro|pass       none prints measurements, repro exits 0 only when hang evidence is observed,\n                                 pass exits 1 if hang evidence is observed. Default: none.\n  --gpu=on|off|auto[,mode...]    Terminal GPU setting(s) to run. Default: on.\n  --cycles=N                     Activation/output cycles per GPU mode. Default: ${defaultCycles}.","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/repro-windows-apphang-terminal-activation.mjs#L63-L99","documentation":"Thrown by the apphang repro harness when --report is passed without a usable file path. The value is trimmed; if empty (from --report= or --report=   ), the harness refuses to write JSON evidence.","triggerScenarios":"Passing --report= with no path, or --report=   (whitespace only). The parser sets reportPath to null after trimming and checks for falsy.","commonSituations":"A developer adds the flag intending to fill the path later, or a shell variable expands to empty.","solutions":["Provide a concrete file path, e.g. --report=./apphang-report.json.","Omit the flag entirely if you do not need a JSON report (output goes to stdout)."],"exampleFix":"// before\nnode config/scripts/repro-windows-apphang-terminal-activation.mjs --report=\n// after\nnode config/scripts/repro-windows-apphang-terminal-activation.mjs --report=./apphang-report.json","handlingStrategy":"validation","validationCode":"const reportPath = value?.trim()\nif (!reportPath) {\n  throw new Error('--report requires a file path.')\n}","typeGuard":"function isNonEmptyTrimmed(value) {\n  return typeof value === 'string' && value.trim().length > 0\n}","tryCatchPattern":null,"preventionTips":["Treat empty/whitespace flag values as missing rather than silently defaulting.","Document that omitting --report sends output to stdout as an alternative."],"tags":["cli","validation","argument-parsing","report"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}