{"record":{"id":"e1c079252c4e1e14","repo":"santifer/career-ops","slug":"missing-score-summary-block-from-model-output","errorCode":null,"errorMessage":"Missing SCORE_SUMMARY block from model output","messagePattern":"Missing SCORE_SUMMARY block from model output","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"batch-evaluate-gemini.mjs","lineNumber":276,"sourceCode":"\n  console.log(`\\n========================================`);\n  console.log(`🔄 Processing [${idx}]: ${companyHint} - ${titleHint}`);\n  console.log(`🔗 URL: ${url}`);\n\n  try {\n    const jdText = await scrapeUrl(browser, url);\n    if (!jdText || jdText.length < 100) {\n      throw new Error('Extracted text too short (likely blocked or empty)');\n    }\n\n    console.log(`🧠 Calling Gemini (${modelName})...`);\n    const evaluationText = await _evaluate(`URL: ${url}\\n\\n${jdText}`);\n\n    // Parse output\n    const summaryMatch = evaluationText.match(/---SCORE_SUMMARY---\\s*([\\s\\S]*?)---END_SUMMARY---/);\n    if (!summaryMatch) {\n      console.error('Missing SCORE_SUMMARY block from model output:\\n' + evaluationText.slice(0, 500));\n      throw new Error('Missing SCORE_SUMMARY block from model output');\n    }\n    \n    const block = summaryMatch[1];\n    const extract = (key) => {\n      const m = block.match(new RegExp(`^\\\\s*${key}:\\\\s*(.+)$`, 'mi'));\n      return m ? m[1].trim() : 'unknown';\n    };\n\n    const company = extract('COMPANY');\n    const role = extract('ROLE');\n    const score = extract('SCORE');\n    const archetype = extract('ARCHETYPE');\n    const legitimacy = extract('LEGITIMACY');\n\n    // Save\n    mkdirSync(PATHS.reports, { recursive: true });\n    mkdirSync(PATHS.trackerAdditions, { recursive: true });\n","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/batch-evaluate-gemini.mjs#L258-L294","documentation":"Output-contract check in processOffer: the Gemini evaluation text did not contain a parseable ---SCORE_SUMMARY---...---END_SUMMARY--- block, so no machine-readable score could be extracted. The model either truncated its answer, ignored the prompt's format instructions, or returned an apology/refusal instead of the Blocks A-G evaluation.","triggerScenarios":"Thrown at batch-evaluate-gemini.mjs:276 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the evaluation — transient format drift often disappears on retry (evaluateWithRetry wraps this path)","If it persists, lower the input size (very long JDs cause truncation) or switch to a higher-capacity model tier","Inspect the raw evaluationText log to see what the model returned instead of the summary block"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aac998c7ed7248ea853b720ceeb1fdbeb322fc5d","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}