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.
Manifest override โ manifest.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.
Localized executive brief โ for non-English <lang>, the
translated sibling executive-brief_<lang>.md (or
extended/executive-brief_<lang>.md) under the run directory.
Resolved via editorial-brief-resolver.ts. This is the authoritative
localized source produced by the news-translate workflow.
English executive brief, verbatim โ the English brief
(executive-brief.md / extended/executive-brief.md) used as a
fall-through when a locale has no translated brief yet.
Artefact editorial H1 โ first # โฆ heading from the first
substantive artefact under the run directory.
Aggregated-markdown H1 โ the first # โฆ heading in the aggregator
output, accepted under the same non-generic rule.
First strong prose paragraph โ the first line of the aggregated
Markdown that survives shouldSkipDescriptionLine.
Localized template โ the per-article-type *_TITLES generator
from src/constants/language-articles.ts. Last resort.
--- IMPLEMENTATION NOTE ---
Following Refactor 6/8 (issue #2034) this file holds the resolver
orchestrator (resolveArticleMetadata) plus per-language dispatch
(resolveOneLanguage, resolvePerLanguageEditorial) that depend on
resolveLocalizedBriefHighlight from editorial-brief-resolver.ts.
Pure leaf helpers live in src/aggregator/metadata/:
Description
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) โ matches the editorial contract documented in
.github/prompts/04-article-generation.mdยง 6.2:manifest.title/manifest.descriptionon the analysis-run manifest, either as a plain string (applied to every language) or aLanguageMap<string>object for explicit per-language values.<lang>, the translated siblingexecutive-brief_<lang>.md(orextended/executive-brief_<lang>.md) under the run directory. Resolved viaeditorial-brief-resolver.ts. This is the authoritative localized source produced by thenews-translateworkflow.executive-brief.md/extended/executive-brief.md) used as a fall-through when a locale has no translated brief yet.# โฆheading from the first substantive artefact under the run directory.# โฆheading in the aggregator output, accepted under the same non-generic rule.*_TITLESgenerator fromsrc/constants/language-articles.ts. Last resort.--- IMPLEMENTATION NOTE ---
Following Refactor 6/8 (issue #2034) this file holds the resolver orchestrator (
resolveArticleMetadata) plus per-language dispatch (resolveOneLanguage,resolvePerLanguageEditorial) that depend onresolveLocalizedBriefHighlightfromeditorial-brief-resolver.ts. Pure leaf helpers live insrc/aggregator/metadata/:metadata/types.tsโResolvedMetadata{Entry},MetadataManifest,ResolveMetadataOptions.metadata/h1-extractor.tsโ first-H1 extraction.metadata/lede-extractor.tsโ strong-prose + lede-after-heading.metadata/heading-rules.tsโ generic/category/lede heading rules.metadata/slug.tsโhumanizeSlug.metadata/artifact-highlight.tsโ editorial-artefact highlight ladder + priority-finding extractor.metadata/template-fallback.tsโbuildTemplateFallback+SEO_CONTEXT_LABELS.metadata/text-utils.tsโ truncation + skip filters.metadata/date-labels.tsโ week/month/quarter/year/term labels.metadata/resolve-helpers.tsโ pure resolver helpers (manifest override, editorial-content, contextual title/description, SEO keywords).New code should import directly from the leaf modules. This barrel is preserved for backward compatibility with existing call sites.