Build article-specific keywords. Editorial floor (2026-05-24 brief): every page MUST surface the four institutional anchors โ Riksdagsmonitor, Riksdag, Regeringen, political intelligence โ in the page's own language, then layer story-specific signal on top.
Ordering (highest signal first):
Brief entities (input.briefEntities) โ bill IDs (HD03267), proposition refs (prop. 2025/26:267), committee report IDs (JuU28), committee codes (JuU, SfU), party codes (M, SD), named entities (SรPO, Migrationsverket, Tidรถavtalet). Mined upstream by brief-extractor.ts from the executive-brief; universal-Swedish identifiers carry across all 14 locales unchanged.
Localized mandatory floor โ LANG_CORE_KEYWORDS[lang] (already includes localized Riksdagsmonitor / parliament / political intelligence) + LANG_GOVERNMENT_KEYWORD[lang] (Regeringen).
Localized article-type label (Propositions โ Lagfรถrslag / Regierungsvorlagen / โฆ). The localized label, not the English articleTypeId slug, so non-EN pages don't leak EN tokens.
Native language name (Svenska, Deutsch, ๆฅๆฌ่ช) โ surfaces the locale in its own script for multilingual SERP routing.
Removed (was leakage / boilerplate):
formatPublicationUpdateKeyword(date, lang) โ "22 maj 2026 uppdatering" is calendar boilerplate, not story signal. The publication date already lives in article:published_time OG meta, the URL slug, and the rendered byline.
topicPhrase + wordsFrom(title) + wordsFrom(description) โ these were chopping rich H1s ("Sweden Abolishes Permanent Residence โฆ") into junk single-word tokens (Sweden, Abolishes, Permanent). Brief entities carry the same semantic ground without prose fragmentation.
Canonical-path slug parts and English Language-Meta name โ both leaked EN tokens into non-EN keyword strings.
EN frontmatter keywords: seed โ historically mixed in via the aggregator's buildArticleKeywords upstream call, which itself used this function. Now seeded purely via briefEntities to keep the pipeline single-source-of-truth.
The English path still accepts the input.keywords seed (the EN frontmatter line) for backward-compat with EN-only tests, but it is appended AFTER brief entities and the mandatory floor, so the deterministic high-signal tokens always lead.
Build article-specific keywords. Editorial floor (2026-05-24 brief): every page MUST surface the four institutional anchors โ
Riksdagsmonitor,Riksdag,Regeringen,political intelligenceโ in the page's own language, then layer story-specific signal on top.Ordering (highest signal first):
input.briefEntities) โ bill IDs (HD03267), proposition refs (prop. 2025/26:267), committee report IDs (JuU28), committee codes (JuU, SfU), party codes (M, SD), named entities (SรPO, Migrationsverket, Tidรถavtalet). Mined upstream bybrief-extractor.tsfrom the executive-brief; universal-Swedish identifiers carry across all 14 locales unchanged.LANG_CORE_KEYWORDS[lang](already includes localized Riksdagsmonitor / parliament / political intelligence) +LANG_GOVERNMENT_KEYWORD[lang](Regeringen).PropositionsโLagfรถrslag/Regierungsvorlagen/ โฆ). The localized label, not the EnglisharticleTypeIdslug, so non-EN pages don't leak EN tokens.Svenska,Deutsch,ๆฅๆฌ่ช) โ surfaces the locale in its own script for multilingual SERP routing.Removed (was leakage / boilerplate):
formatPublicationUpdateKeyword(date, lang)โ"22 maj 2026 uppdatering"is calendar boilerplate, not story signal. The publication date already lives inarticle:published_timeOG meta, the URL slug, and the rendered byline.topicPhrase+wordsFrom(title) + wordsFrom(description)โ these were chopping rich H1s ("Sweden Abolishes Permanent Residence โฆ") into junk single-word tokens (Sweden,Abolishes,Permanent). Brief entities carry the same semantic ground without prose fragmentation.keywords:seed โ historically mixed in via the aggregator'sbuildArticleKeywordsupstream call, which itself used this function. Now seeded purely viabriefEntitiesto keep the pipeline single-source-of-truth.The English path still accepts the
input.keywordsseed (the EN frontmatter line) for backward-compat with EN-only tests, but it is appended AFTER brief entities and the mandatory floor, so the deterministic high-signal tokens always lead.