Riksdagsmonitor Intelligence Platform โ€” API Documentation - v1.0.30
    Preparing search index...
    • Derive <title> / <meta description> / keyword-entity overrides from the executive-brief markdown adjacent to article.md. Pure function โ€” no I/O, no clock.

      Resolution order:

      1. For non-EN, prefer RenderArticleInput.localizedBriefMarkdown via extractLocalizedBriefSeo. Title and description are resolved independently: a banned title with a clean BLUF still localizes the description, and a clean title with an empty BLUF still localizes the title.
      2. Whatever field is still null after step 1 falls through to the English brief โ€” title via readFirstHeading โ†’ cleanArticleTitle; description via composeRichDescription โˆฅ readBlufParagraph โˆฅ readFirstParagraph, capped by per-language SERP window in truncateToSentenceBoundary.
      3. Entities are mined from the brief (localized first, EN fallback) โ€” universal-Swedish identifiers (HD03267, JuU/SfU) carry across locales.

      Returns { title: undefined, description: undefined, entities: [] } when no brief markdown is provided so the head-metadata helper falls back to the legacy frontmatter-only audit path (covers the 278 pre- 2026-03-26 news/*-en.html files whose source analysis/daily/ directories have been deleted).

      Exported for testability.

      Parameters

      • input: {
        ย ย ย ย lang: Language;
        ย ย ย ย englishBriefMarkdown?: string;
        ย ย ย ย localizedBriefMarkdown?: string;
        ย ย ย ย subfolderSlug?: string;
        }

      Returns { title: string; description: string; entities: readonly string[] }