Skip to content

Comments

Fix structured data and metadata inconsistencies in chamber-debates-update news package#474

Merged
pethers merged 2 commits intonews-realtime/20260223-1400-ee8359f3dc28bf54from
copilot/sub-pr-473
Feb 23, 2026
Merged

Fix structured data and metadata inconsistencies in chamber-debates-update news package#474
pethers merged 2 commits intonews-realtime/20260223-1400-ee8359f3dc28bf54from
copilot/sub-pr-473

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

Six data quality issues in the 2026-02-23 chamber-debates-update PR: wrong article type in Arabic index, truncated JSON-LD descriptions in EN/SV, double-escaped entities in FR JSON-LD, empty metadata fields across all 13 language entries in news-articles.json, missing FR entry entirely, and missing schema fields in last-generation.json.

Fixes

  • news/index_ar.html"type": "prospective""analysis" to match all 13 other language indexes
  • news/index.html — JSON-LD description truncated mid-word ("...transport and occu") replaced with full sentence
  • news/index_sv.html — JSON-LD description truncated mid-token ("...granskning till transport- ") replaced with full sentence
  • news/index_fr.html — Double-escaped entities in application/ld+json block fixed:
    "Motions d'opposition" → "Motions d'opposition"
    
  • data/news-articles.json — Populated articleSection, wordCount, keywords, and url (all were empty/0) for all 13 chamber-debates-update entries using values extracted from the actual article HTML; inserted missing fr entry, bringing slug coverage to 14/14 languages and totalArticles to 613
  • news/metadata/last-generation.json — Added "status": "success" and "note": "" to match the schema emitted by generate-news-enhanced.ts

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update articles for live interpellation debates in Riksdag Fix structured data and metadata inconsistencies in chamber-debates-update news package Feb 23, 2026
Copilot AI requested a review from pethers February 23, 2026 17:01
@pethers pethers marked this pull request as ready for review February 23, 2026 17:09
@pethers pethers merged commit 09b901d into news-realtime/20260223-1400-ee8359f3dc28bf54 Feb 23, 2026
@pethers pethers deleted the copilot/sub-pr-473 branch February 23, 2026 17:09
Copilot AI added a commit that referenced this pull request Feb 23, 2026
…cleanly

origin/main had advanced ~20 commits (PRs #467, #469, #473, #474, #475) since
last conflict resolution. Take FETCH_HEAD as clean base and re-apply every
PR-specific change on top:

data-transformers.ts:
  - svSpan(): fix data-translate direction (lang!='sv' → marker; lang='sv' → none)
  - Add PROP_REFERENCE_REGEX (strict \d{4}\/\d{2}:\d+), PROP_FULL_REF_REGEX
    (non-greedy HTML-safe), PROP_TITLE_SUFFIX_REGEX (title suffix capture)
  - extractPropRef: use PROP_REFERENCE_REGEX (was \S+)
  - Export groupMotionsByProposition (was private)
  - Add exported groupPropositionsByCommittee
  - generatePropositionsContent: committee-grouped rendering via
    groupPropositionsByCommittee (h3 committee + h4 props when multi-committee;
    h3 props + referredLine when single-committee; domainCount from map.size)
  - generateMotionsContent: parameterize renderMotion(motion, headingTag='h3');
    grouped motions → h4; independent → h3; replace 14-branch ternary chains
    with L(lang,'responsesToProp') / L(lang,'independentMotions'); use
    PROP_TITLE_SUFFIX_REGEX for propTitle extraction; svSpan on prop title
  - Add responsesToProp + independentMotions to all 14 language objects

scripts/types/content.ts:
  - Add responsesToProp: string; independentMotions: string to ContentLabelSet

tests/data-transformers.test.ts:
  - Import groupMotionsByProposition and groupPropositionsByCommittee
  - Fix 8 svSpan assertions: non-sv → toContain; sv article → not.toContain
  - Add h3/h4 hierarchy assertions to grouped motions rendering tests
  - Add 5 unit tests for groupMotionsByProposition exported helper
  - Add 5 unit tests for groupPropositionsByCommittee exported helper
  - Add 28 label-presence tests (2 keys × 14 langs)
  - Add 4 rendering tests (single/multi-committee h3/h4, referredLine)

sitemap.xml: take origin/main version

All 1672 tests pass across 39 test files

Co-authored-by: pethers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants