koala73/worldmonitor · error

/accuracy/ meta description must be 155–160 chars (got ${len

Error message

/accuracy/ meta description must be 155–160 chars (got ${length})

What it means

assertMetaDescription in the /accuracy/ page build script validates that the generated meta description is between 155 and 160 characters (counted with code-point spread [...description]). SEO constraints from the site's build contract require this exact window; if the composed description is shorter or longer the build aborts with this error. It exists to keep the SEO description fully visible in search results.

Solutions

  1. Measure the generated description with [...description].length and add or remove words until it is 155-160 characters.
  2. If content changes shortened it, extend the description template with factual filler text about the accuracy scorecard.
  3. If it is too long, trim the provenance or summary sentence that feeds into the description.
  4. Verify with the spread operator, not .length, so multi-byte characters are counted as one.

Example fix

// before
const metaDescription = `Accuracy data for ${dataset}.`;
// after
const metaDescription = `Accuracy data for ${dataset}: verified sources, freshness timestamps and methodology behind every WorldMonitor intelligence dashboard figure.`;
Defensive patterns

Strategy: validation

Validate before calling

const desc = buildMetaDescription(state, dataset);
const len = [...desc].length;
if (len < 155 || len > 160) throw new Error(`meta description ${len} chars, need 155-160: "${desc}"`);

Type guard

const isMetaLenOk = (s) => { const n = [...s].length; return n >= 155 && n <= 160; };

Try / catch

try {
  await buildAccuracyPage();
} catch (e) {
  if (String(e.message).includes('meta description must be')) {
    console.error('Adjust accuracy meta description length:', e.message);
    process.exitCode = 1;
  } else throw e;
}

Prevention

When it happens

Trigger: Running scripts/build-accuracy-page.mjs when the meta description string assembled from page content (provenance line, dataset state, etc.) has a code-point length below 155 or above 160.

Common situations: Editing accuracy-page copy, provenance text, or template strings and accidentally shortening or lengthening the composed description; character-count changes from emoji/unicode text counted differently; a content revision that drops a sentence from the description template.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of koala73/worldmonitor@7d06c8633d (2026-09-15). Data as JSON: /api/errors/1e2e7506df5df8a8. Report an issue: GitHub.

Appendix: source

Thrown at scripts/build-accuracy-page.mjs:606

      <h2>Resolution ledger</h2>
${totalsTable(scorecard.totals, escapeHtml)}
      <p>${escapeHtml(scorecard.methodology)}</p>
      <h2>Calibration</h2>
${calibrationTable(scorecard, escapeHtml)}
      <h2>Accuracy by domain</h2>
${domainTable(scorecard.byDomain, escapeHtml)}
      <h2>Accuracy by generation origin</h2>
${originTable(scorecard.byGenerationOrigin, scorecard.skill, escapeHtml)}
${marketSection(scorecard.vsMarketSkill, escapeHtml)}
${limitsSection(omittedBuckets, escapeHtml)}
${relatedSection(baseUrl, tpl)}
${provenanceLine(state, dataset, snapshotPath, escapeHtml)}`;
}

function assertMetaDescription(description) {
  const length = [...description].length;
  if (length < 155 || length > 160) {
    throw new Error(`/accuracy/ meta description must be 155–160 chars (got ${length})`);
  }
}

function accuracyDatasetLd({ baseUrl, tpl, state, dataset }) {
  const { absoluteUrl } = tpl;
  const canonical = absoluteUrl(baseUrl, ACCURACY_PAGE_PATH);
  return {
    '@context': SCHEMA_ORG_CONTEXT_URL,
    '@type': 'Dataset',
    '@id': `${canonical}#dataset`,
    name: 'World Monitor forecast resolution scorecard',
    description:
      'Aggregate accuracy of World Monitor forecasts over a rolling window: Brier and log scores for the headline cohort and for every scored entry, calibration buckets with their sample sizes, per-domain and per-origin breakdowns, void rates, and a head-to-head against liquid prediction markets. Frozen from the credentialed forecast scorecard API into a committed snapshot, so the published figures and the machine-readable distribution always agree.',
    identifier: DATASET_IDENTIFIER,
    keywords: [
      'forecast accuracy',
      'Brier score',
      'forecast calibration',

View on GitHub (pinned to 7d06c8633d)