Fix structured data and metadata inconsistencies in chamber-debates-update news package#474
Merged
pethers merged 2 commits intonews-realtime/20260223-1400-ee8359f3dc28bf54from Feb 23, 2026
Conversation
…sing metadata, status fields Co-authored-by: pethers <[email protected]>
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
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inlast-generation.json.Fixes
news/index_ar.html—"type": "prospective"→"analysis"to match all 13 other language indexesnews/index.html— JSON-LD description truncated mid-word ("...transport and occu") replaced with full sentencenews/index_sv.html— JSON-LD description truncated mid-token ("...granskning till transport- ") replaced with full sentencenews/index_fr.html— Double-escaped entities inapplication/ld+jsonblock fixed:data/news-articles.json— PopulatedarticleSection,wordCount,keywords, andurl(all were empty/0) for all 13 chamber-debates-update entries using values extracted from the actual article HTML; inserted missingfrentry, bringing slug coverage to 14/14 languages andtotalArticlesto 613news/metadata/last-generation.json— Added"status": "success"and"note": ""to match the schema emitted bygenerate-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.