{"record":{"id":"26705625e19ef0dc","repo":"chenglou/pretext","slug":"missing-letter-spacing-result-for-testcase-label","errorCode":null,"errorMessage":"Missing letter-spacing result for ${testCase.label}","messagePattern":"Missing letter-spacing result for (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/letter-spacing-check.ts","lineNumber":238,"sourceCode":"        `&reportEndpoint=${encodeURIComponent(reportServer.endpoint)}`\n      const batchReport = await loadPostedReport(\n        session,\n        url,\n        () => reportServer.waitForReport(null),\n        requestId,\n        reportBrowser,\n        timeoutMs,\n      )\n      if (batchReport.status === 'error') {\n        throw new Error(batchReport.message ?? 'letter-spacing batch failed')\n      }\n\n      const batchResults = batchReport.results ?? []\n      const reportsByLabel = new Map(batchResults.map(result => [result.label, result.report]))\n      for (const testCase of LETTER_SPACING_ORACLE_CASES) {\n        const report = reportsByLabel.get(testCase.label)\n        if (report === undefined) {\n          throw new Error(`Missing letter-spacing result for ${testCase.label}`)\n        }\n        printCaseResult(browser, testCase, report)\n        results.push(toOracleResult(browser, testCase, report))\n      }\n    } finally {\n      reportServer.close()\n    }\n  } finally {\n    session?.close()\n    serverProcess?.kill()\n    lock.release()\n  }\n\n  return results\n}\n\nfunction buildSnapshot(results: OracleResult[]): OracleSnapshot {\n  const geometryMatchCount = results.filter(result => result.geometryMatches).length","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/chenglou/pretext/blob/ac49b09b7d83ede19581fa94a8b892b07d309baf/scripts/letter-spacing-check.ts#L220-L256","documentation":"After a 'ready' batch report, runBrowser() looks up each LETTER_SPACING_ORACLE_CASES label in the results map and throws if one is absent. The batch round-trip succeeded but the result set is incomplete relative to the defined oracle cases.","triggerScenarios":"The probe page posted a 'ready' report but omitted a result for a label declared in src/test-data.ts LETTER_SPACING_ORACLE_CASES — e.g. a new case was added without wiring it into the probe batch handler, or a per-case exception swallowed a result on the page.","commonSituations":"Adding an oracle case to test-data.ts without updating the probe batch renderer; a silent per-case error in the page.","solutions":["Cross-check src/test-data.ts LETTER_SPACING_ORACLE_CASES labels against the labels the probe batch page emits.","Inspect the page console for a swallowed per-case exception.","If a case is intentionally skipped, remove it from LETTER_SPACING_ORACLE_CASES rather than leaving it unproduced."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const produced = new Set((batchReport.results ?? []).map(r => r.label))\nconst missing = LETTER_SPACING_ORACLE_CASES.filter(c => !produced.has(c.label))\nif (missing.length) {\n  console.error(`Probe omitted labels: ${missing.map(c => c.label).join(', ')}`)\n  process.exit(1)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When adding a case to LETTER_SPACING_ORACLE_CASES, wire it into the probe batch renderer in the same change.","Surface per-case exceptions on the probe page instead of swallowing them."],"tags":["browser-automation","probe","test-data","letter-spacing"],"backgroundTag":null,"analyzedSha":"ac49b09b7d83ede19581fa94a8b892b07d309baf","analyzedAt":"2026-08-12T17:03:16.263Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}