Skip to content

Localize executive-brief lead in news HTML + sharpen brief headline tradecraft#2834

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/improve-executive-briefs-generation
Draft

Localize executive-brief lead in news HTML + sharpen brief headline tradecraft#2834
Copilot wants to merge 2 commits into
mainfrom
copilot/improve-executive-briefs-generation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 29, 2026

Non-English news pages opened with the English executive brief even when a localized executive-brief_<lang>.md existed, and every page embedded all 13 localized briefs inline as ## Executive Brief Sv/De/… carrier sections (a representative proposition page was ~428 KB). The localized brief was only feeding the SEO <title>/<meta description> cascade — never the on-page body lead.

This brings the on-page lead into lock-step with that SEO cascade (localized if it exists, English otherwise) and strips the inline carrier bloat.

Changes

  • New scripts/render-lib/article-brief-lead.ts — pure (no-I/O) markdown transform applied by renderArticleHtml per language:
    • stripEmbeddedLocalizedBriefSections() removes every ## Executive Brief <Lang> carrier for all languages.
    • For non-English with a localized brief, the first <h2> lead-section body (## What Happened) is swapped to the cleaned executive-brief_<lang>.md — reusing the aggregator's cleanArtifactBody + rewriteRelativeLinks pipeline, deliberately skipping normalizeNarrativeTerminology so English first-use glosses never leak into localized prose. Lead heading stays the language-stable English ## What Happened (TOC localizes its label separately); provenance comment repoints to executive-brief_<lang>.md.
    • English, missing-brief, and empty/whitespace-brief all retain the English lead — mirroring SEO fallback layer Fix MCP server paths and add rule-based Copilot instructions #4.
  • Wired into scripts/render-lib/article.ts renderArticleHtml.
  • Carrier exclusion from the artifact listresolveArtifactList (render-articles.ts) and isReaderGuideEligible (aggregator/reader-guide.ts) now skip executive-brief_<lang>.md, so they no longer surface as Reader Intelligence Guide rows (which would dangle once the body carriers are stripped), Article Sources cards, or JSON-LD isBasedOn. They are translations of executive-brief.md, not independent analytical artifacts.
  • analysis/methodologies/ai-driven-analysis-guide.md — added a 🪝 Headline-tradecraft block (named actor + active verb + concrete stake, SERP-safe ≤70 chars, no date-stuffing, localize the angle not the words) and made Step 2B / Step 7 explicit that the brief H1/BLUF is now the on-page lead in every language, not just metadata.
  • Article-Generation.md — documents the on-page lead localization step alongside the existing metadata cascade.
  • tests/article-brief-lead.test.ts — 12 cases: carrier strip across all langs incl. EN, localized swap, EN passthrough, missing/empty fallback, provenance repoint, front-matter/H1 cleaning + ##### demotion, legacy ## Executive Brief H2, single-H2 lead.

Analysis findings (requested)

  • article.md completeness: all 22 root analytical artifacts on disk are aggregated (each carries a source: comment) — no valuable content is missing. The sole redundancy was the 13 translation carriers, which are functionally dead weight in HTML (SEO reads executive-brief_<lang>.md from disk, not the embedded copies) and are now stripped at render.

Notes

  • Verified renders for sv/ja/ar/en (2026-05-20/propositions): localized lead present, no English leak, zero carriers, ~428 KB → ~307 KB. Sample page renders were reverted — bulk HTML regeneration lands as its own dedicated commit per repo convention, so this PR is code + tests + docs only.

Copilot AI and others added 2 commits May 29, 2026 23:14
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot AI requested a review from pethers May 29, 2026 23:26
@github-actions github-actions Bot added documentation Documentation updates testing Test coverage refactor Code refactoring size-l Large change (250-1000 lines) labels May 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🏷️ Automatic Labeling Summary

This PR has been automatically labeled based on the files changed and PR metadata.

Applied Labels: documentation,testing,refactor,size-l

Label Categories

  • 🗳️ Content: news, dashboard, visualization, intelligence
  • 💻 Technology: html-css, javascript, workflow, security
  • 📊 Data: cia-data, riksdag-data, data-pipeline, schema
  • 🌍 I18n: i18n, translation, rtl
  • 🔒 ISMS: isms, iso-27001, nist-csf, cis-controls
  • 🏗️ Infrastructure: ci-cd, deployment, performance, monitoring
  • 🔄 Quality: testing, accessibility, documentation, refactor
  • 🤖 AI: agent, skill, agentic-workflow

For more information, see .github/labeler.yml.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation updates refactor Code refactoring size-l Large change (250-1000 lines) testing Test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants