Conversation
Generate weekly-review articles covering Feb 15-22 parliamentary activity: - 30 committee reports (NU, SfU, CU committees) - 13 government propositions (Justice, Finance, Defence, Climate) - 8 opposition motions (responding to props 118-121) Key topics: migration/citizenship reform, nuclear energy, social insurance, weapons law amendments, Ukraine support budget, macroprudential supervision. Bug fixes: - mcp-client.ts: Fix searchDocuments() to use 'dokument' field (Swedish API) - weekly-review.ts: Use specific MCP tools (betänkanden, propositioner, motioner) instead of generic search_dokument Articles generated in all 14 languages with full translation post-processing. Co-authored-by: Copilot <[email protected]>
|
✅ Pull request created: #433 |
There was a problem hiding this comment.
Pull request overview
This pull request generates a weekly review news article covering Swedish parliamentary activity from February 15-22, 2026, in 14 languages. The PR includes important bug fixes to the MCP client's document search functionality and rewrites the weekly review data fetching logic to use specific MCP tools rather than generic search.
Changes:
- Fixed
searchDocuments()in MCP client to handle Swedish API field name (dokumentinstead ofdocuments) - Rewrote weekly review data fetching to use
fetchCommitteeReports,fetchPropositions, andfetchMotionsfor cleaner type handling - Generated 14 weekly review article HTML files (one per language)
- Updated all 14 news index files with new article entries
- Updated metadata files and news articles registry
Reviewed changes
Copilot reviewed 33 out of 34 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/mcp-client.ts | Added fallback to handle both 'dokument' and 'documents' field names from Swedish API |
| scripts/news-types/weekly-review.ts | Rewrote to fetch specific document types via dedicated MCP methods with date filtering |
| news/metadata/last-generation.json | Simplified structure for weekly review generation tracking |
| news/metadata/batch-status.json | ISSUE: Shows only 4 languages completed despite 14 being generated |
| news/index*.html (14 files) | Added new weekly review article to each language's news index |
| news/2026-02-22-weekly-review-*.html (14 files) | New article HTML files with proper structure and i18n |
| data/news-articles.json | Updated registry with 15 new article entries (14 weekly review + 1 missing Hebrew article) |
| "completedLanguages": [ | ||
| "en", | ||
| "sv", | ||
| "da", | ||
| "no", | ||
| "fi", | ||
| "de", | ||
| "fr", | ||
| "es", | ||
| "nl", | ||
| "ar", | ||
| "he", | ||
| "ja", | ||
| "ko", | ||
| "zh" | ||
| ], | ||
| "remainingLanguages": [], | ||
| "allRequestedLanguages": [ | ||
| "en", | ||
| "sv", | ||
| "da", | ||
| "no", | ||
| "fi", | ||
| "de", | ||
| "fr", | ||
| "es", | ||
| "nl", | ||
| "ar", | ||
| "he", | ||
| "ja", | ||
| "ko", | ||
| "zh" |
There was a problem hiding this comment.
The batch-status.json file shows only 4 completed languages (he, ja, ko, zh) but the PR description and all other evidence indicates 14 languages were successfully generated. This is inconsistent with the fact that:
- 14 article HTML files were created (en, sv, da, no, fi, de, fr, es, nl, ar, he, ja, ko, zh)
- All 14 language index files were updated
- The last-generation.json shows 14 languages
- The PR title claims "14 languages"
This metadata file should list all 14 languages in completedLanguages and allRequestedLanguages arrays.
scripts/news-types/weekly-review.ts
Outdated
| for (const d of recentReports) (d as Record<string, string>).doktyp = (d as Record<string, string>).doktyp || 'bet'; | ||
| for (const d of recentPropositions) (d as Record<string, string>).doktyp = (d as Record<string, string>).doktyp || 'prop'; | ||
| for (const d of recentMotions) (d as Record<string, string>).doktyp = (d as Record<string, string>).doktyp || 'mot'; |
There was a problem hiding this comment.
The doktyp tagging logic explicitly sets doktyp on documents that may already have it. Lines 121-123 use the pattern d.doktyp || 'bet' which means: "if doktyp doesn't exist, set it to 'bet'". However, the code unconditionally assigns to doktyp even when the document might already have the correct type from the API.
Consider changing to only set doktyp when it's actually missing:
if (!d.doktyp) (d as Record<string, string>).doktyp = 'bet';This would be safer and more explicit about the intention.
|
@copilot open a new pull request to apply changes based on the comments in this thread |
… for doktyp assignment Co-authored-by: pethers <[email protected]>
fix: correct batch-status.json languages and weekly-review doktyp guard
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
scripts/news-types/weekly-review.ts
Outdated
| const [reports, propositions, motions] = await Promise.all([ | ||
| client.fetchCommitteeReports(30, '2025/26').catch(() => [] as unknown[]), | ||
| client.fetchPropositions(30, '2025/26').catch(() => [] as unknown[]), | ||
| client.fetchMotions(30, '2025/26').catch(() => [] as unknown[]), | ||
| ]); |
There was a problem hiding this comment.
Silent error swallowing in catch blocks could hide API failures. The empty catch blocks on lines 104-106 return empty arrays without logging errors, making it difficult to diagnose API or network failures in production. Consider logging errors before returning empty arrays, for example: .catch((err) => { console.error('Failed to fetch committee reports:', err); return [] as unknown[]; })
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
|
@copilot open a new pull request to apply changes based on the comments in this thread and fix FAIL tests/news-types/weekly-review.test.ts > Weekly Review Article Generation > Data Collection > should fetch documents from MCP ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/7]⎯ FAIL tests/news-types/weekly-review.test.ts > Weekly Review Article Generation > Data Collection > should handle empty documents
❯ tests/news-types/weekly-review.test.ts:132:30 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/7]⎯ FAIL tests/news-types/weekly-review.test.ts > Weekly Review Article Generation > Article Structure > should generate articles for requested languages
❯ tests/news-types/weekly-review.test.ts:143:30 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/7]⎯ FAIL tests/news-types/weekly-review.test.ts > Weekly Review Article Generation > Article Structure > should include correct slug format ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/7]⎯ FAIL tests/news-types/weekly-review.test.ts > Weekly Review Article Generation > Multi-Language > should generate language-specific titles ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/7]⎯ FAIL tests/news-types/weekly-review.test.ts > Weekly Review Article Generation > Integration with Writer > should call writeArticle function if provided ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/7]⎯ FAIL tests/news-types/weekly-review.test.ts > Weekly Review Article Generation > Integration with Writer > should work without writeArticle function
❯ tests/news-types/weekly-review.test.ts:221:30 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[7/7]⎯ Test Files 1 failed | 38 passed (39) Also want to improve/extend it should get all the last weeks documents and anayse them completly. Need to analyse every single document complely. still to much list based and not much enough political analyst, intelligence op perspective. no edge, Analyse produce articles, english is enough sample cia-data exist single person motion is for example 99+ % of being denied. many csv will provide context and history of trends in general (may not be updated weekly, but distribution,percentages stats hold) |
…ahead REQUIRED_TOOLS comment + regen indexes Co-authored-by: pethers <[email protected]>
fix: mcp-client json resilience, monthly-review step docs, month-ahead REQUIRED_TOOLS conditional annotation
|
@copilot merge all changes in this branch with main branch, so all merge conflicts are resolved and all news/index and meta data complete This branch has conflicts that must be resolved data/news-articles.json |
…cles and regenerate all indexes Co-authored-by: pethers <[email protected]>
…spective keywords to prevent false positives Co-authored-by: pethers <[email protected]>
fix: resolve merge conflicts with main - integrate weekend articles and fix prospective keyword false positives
|
@copilot merge all changes in this branch with main branch, so all merge conflicts are resolved and all news/index and meta data complete Prio 1, make sure this branch can be merged without conflicts. do it, This branch has conflicts that must be resolved data/news-articles.json |
…rom both branches Co-authored-by: pethers <[email protected]>
…ete article set Co-authored-by: pethers <[email protected]>
Co-authored-by: pethers <[email protected]>
fix: resolve merge conflicts between copilot/sub-pr-433 and main
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
📰 Weekly Review: February 15-22, 2026
Summary
Automated weekly review covering parliamentary activity from Feb 15-22, 2026.
Data Analyzed
Key Topics
Languages
All 14 languages: EN, SV, DA, NO, FI, DE, FR, ES, NL, AR, HE, JA, KO, ZH
Bug Fixes
scripts/mcp-client.ts: FixedsearchDocuments()to usedokumentfield name (Swedish API returnsdokumentnotdocuments)scripts/news-types/weekly-review.ts: Rewrote data fetching to use specific MCP tools (fetchCommitteeReports,fetchPropositions,fetchMotions) instead of genericsearch_dokumentwhich returned mixed record typesFiles Changed
news/2026-02-22-weekly-review-*.html)data/news-articles.json,sitemap.xmlnews/metadata/last-generation.jsonscripts/mcp-client.tsandscripts/news-types/weekly-review.ts