{"record":{"id":"2e03f0b47b2a0249","repo":"santifer/career-ops","slug":"openai-eval-mjs-exited-res-status-res-stder","errorCode":null,"errorMessage":"openai-eval.mjs exited ${res.status}: ${(res.stderr || '').slice(0, 200)}","messagePattern":"openai-eval\\.mjs exited (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"eval-golden.mjs","lineNumber":159,"sourceCode":"    // path separators, or the fixture lands in a phantom subdirectory. Sanitize\n    // to a flat filename — record fixtures under the same sanitized name.\n    const fixture = join(fixtureDir, `${testCase.id}__${fixtureModelId(model)}.txt`);\n    if (!existsSync(fixture)) {\n      throw new Error(`missing replay fixture: ${fixture} — record it or run --live`);\n    }\n    return readFileSync(fixture, 'utf8');\n  }\n\n  // live: write the JD to a temp file and run the existing evaluator.\n  const dir = mkdtempSync(join(tmpdir(), 'eval-golden-'));\n  try {\n    const jdFile = join(dir, 'jd.txt');\n    writeFileSync(jdFile, testCase.jd);\n    const res = spawnSync(process.execPath,\n      [join(ROOT, 'openai-eval.mjs'), '--file', jdFile, '--model', model, '--no-save'],\n      { encoding: 'utf8', env: process.env, timeout: 360000 });\n    if (res.status !== 0) {\n      throw new Error(`openai-eval.mjs exited ${res.status}: ${(res.stderr || '').slice(0, 200)}`);\n    }\n    return res.stdout || '';\n  } finally {\n    rmSync(dir, { recursive: true, force: true });\n  }\n}\n\n/**\n * Median of a numeric array (0 for an empty array).\n *\n * @param {number[]} xs - Values to summarize.\n * @returns {number} The median value.\n */\nfunction median(xs) {\n  if (xs.length === 0) return 0;\n  const s = [...xs].sort((a, b) => a - b);\n  const mid = Math.floor(s.length / 2);\n  return s.length % 2 ? s[mid] : (s[mid - 1] + s[mid]) / 2;","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/santifer/career-ops/blob/9b17a8ac97b398a496b38e423ae24e433b43254f/eval-golden.mjs#L141-L177","documentation":"Error \"openai-eval.mjs exited ${res.status}: ${(res.stderr || '').slice(0, 200)}\" thrown in santifer/career-ops.","triggerScenarios":"Thrown at eval-golden.mjs:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the stderr excerpt in the message for the root cause (usually a missing API key or invalid case file).","Fix the underlying openai-eval.mjs failure and re-run."],"exampleFix":"node openai-eval.mjs --case fixtures/case1.json  # reproduce directly","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b17a8ac97b398a496b38e423ae24e433b43254f","analyzedAt":"2026-08-13T00:48:39.135Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}