EU Parliament Monitor — API Documentation - v0.8.43
    Preparing search index...

    Module Aggregator/ArticleMetadata

    Resolve per-language {title, description} for an article rendered by the aggregator pipeline. The resolver follows a strict priority ladder that prefers real editorial highlights over boring, repeated templates — satisfying the core SEO requirement that every published article carry a unique, content-reflective headline and description in every language variant.

    Priority ladder (per language, highest wins):

    1. Manifest overridemanifest.title / manifest.description on the analysis-run manifest, either as a plain string (applied to every language) or a LanguageMap<string> object for explicit per-language values. Authored by Stage-B agents when they have an editorial headline for the day.
    2. Artefact editorial H1 — first # … heading from the first substantive artefact under the run directory (e.g. intelligence/synthesis-summary.md, breaking-news-analysis.md). Accepted only when the heading is not a generic ${humanize(articleType)} — ${date} form.
    3. Aggregated-markdown H1 — the first # … heading in the aggregator output, accepted under the same non-generic rule. In practice this tier rarely fires because the aggregator itself writes the generic default, but it covers hand-edited or legacy aggregates.
    4. First strong prose paragraph — the first line of the aggregated Markdown that survives shouldSkipDescriptionLine. Used for description; also used for title as a last editorial-content resort when every heading-level source is generic.
    5. Localized template — the per-article-type *_TITLES generator from src/constants/language-articles.ts. Always parameterised by date (or derived values), so the title changes from run to run even when this last tier fires — but still the "boring repeated" option.

    English highlights (tiers 2–4) are reserved for the en language variant; non-English variants skip them and drop to the localized template (tier 5) unless an explicit manifest.title.<lang> / manifest.description.<lang> override is present. This guarantees every variant's <title> and <meta description> are in the correct locale even while the article body itself is still rendered from an English source (until per-language body translations ship).

    Functions

    shouldSkipDescriptionLine
    stripInlineMarkdown
    truncateDescription
    truncateTitle
    extractFirstH1
    extractStrongProseLine
    humanizeSlug
    isGenericHeading
    extractArtifactHighlight
    buildTemplateFallback
    deriveWeekRange
    deriveMonthLabel
    resolveArticleMetadata

    Interfaces

    ResolvedMetadataEntry
    MetadataManifest
    ResolveMetadataOptions

    Type Aliases

    ResolvedMetadata