chenglou/pretext · error · Error

Missing letter-spacing result for ${testCase.label}

Error message

Missing letter-spacing result for ${testCase.label}

What it means

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.

Source

Thrown at scripts/letter-spacing-check.ts:238

        `&reportEndpoint=${encodeURIComponent(reportServer.endpoint)}`
      const batchReport = await loadPostedReport(
        session,
        url,
        () => reportServer.waitForReport(null),
        requestId,
        reportBrowser,
        timeoutMs,
      )
      if (batchReport.status === 'error') {
        throw new Error(batchReport.message ?? 'letter-spacing batch failed')
      }

      const batchResults = batchReport.results ?? []
      const reportsByLabel = new Map(batchResults.map(result => [result.label, result.report]))
      for (const testCase of LETTER_SPACING_ORACLE_CASES) {
        const report = reportsByLabel.get(testCase.label)
        if (report === undefined) {
          throw new Error(`Missing letter-spacing result for ${testCase.label}`)
        }
        printCaseResult(browser, testCase, report)
        results.push(toOracleResult(browser, testCase, report))
      }
    } finally {
      reportServer.close()
    }
  } finally {
    session?.close()
    serverProcess?.kill()
    lock.release()
  }

  return results
}

function buildSnapshot(results: OracleResult[]): OracleSnapshot {
  const geometryMatchCount = results.filter(result => result.geometryMatches).length

View on GitHub (pinned to ac49b09b7d)

Solutions

  1. Cross-check src/test-data.ts LETTER_SPACING_ORACLE_CASES labels against the labels the probe batch page emits.
  2. Inspect the page console for a swallowed per-case exception.
  3. If a case is intentionally skipped, remove it from LETTER_SPACING_ORACLE_CASES rather than leaving it unproduced.
Defensive patterns

Strategy: validation

Validate before calling

const produced = new Set((batchReport.results ?? []).map(r => r.label))
const missing = LETTER_SPACING_ORACLE_CASES.filter(c => !produced.has(c.label))
if (missing.length) {
  console.error(`Probe omitted labels: ${missing.map(c => c.label).join(', ')}`)
  process.exit(1)
}

Prevention

When it happens

Trigger: 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.

Common situations: Adding an oracle case to test-data.ts without updating the probe batch renderer; a silent per-case error in the page.

Related errors


AI-assisted analysis of chenglou/pretext@ac49b09b7d (2026-08-12). Data as JSON: /api/errors/26705625e19ef0dc. Report an issue: GitHub.