Conversation
Generate committee reports, government propositions, and opposition motions articles in 14 languages from riksdag-regering-mcp data. Co-authored-by: Copilot <[email protected]>
|
@copilot now articles. use mcp server to get documents reference and extend with description, commentary and analysis |
…ent data Co-authored-by: pethers <[email protected]>
Co-authored-by: pethers <[email protected]>
Co-authored-by: pethers <[email protected]>
Co-authored-by: pethers <[email protected]>
Co-authored-by: pethers <[email protected]>
Co-authored-by: pethers <[email protected]>
Co-authored-by: pethers <[email protected]>
- Extract metadata from all 347 articles across 14 languages - Update all 14 news/index*.html with current titles and descriptions - Generate complete sitemap.xml with 574 URLs (was missing 197 docs files) - Include docs/api (135 files) and docs/coverage (62 files) in sitemap - Fix Schema.org ItemList numberOfItems to match actual articles - Validate all JSON-LD structured data Sitemap coverage: - 347 news articles - 135 docs/api HTML files - 62 docs/coverage HTML files - 30 index and root pages All index files now have synchronized metadata matching current articles. Co-authored-by: pethers <[email protected]>
Enhance 2026-02-19 articles with MCP document data and translate to Nordic languages
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
|
✓ tests/mcp-client-core-part1.test.js > MCPClient > request > should not add prefix when using direct server URL 1ms ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 2 ⎯⎯⎯⎯⎯⎯⎯ FAIL tests/mcp-client-core-part1.test.js > MCPClient > request > should add prefix when using MCP gateway URL Expected: "riksdag-regering--test_tool" ❯ tests/mcp-client-core-part1.test.js:332:32 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯ FAIL tests/mcp-client-core-part1.test.js > MCPClient > request > should try without prefix if gateway returns Internal error Caused by: Error: MCP tool error: Internal error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯ Test Files 1 failed | 34 passed (35) agentic workflow modified client, analyse why and improve code or test or documentation . adress all issues and run all unit test. check gh aw session for detailed data about what happend |
… workflow Co-authored-by: pethers <[email protected]>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
Fix placeholder "..." content in 20 non-English/non-Nordic news articles for 2026-02-19
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
| <h2>정당 분석</h2> | ||
| <p>...</p> | ||
|
|
||
| <h2>전망</h2> | ||
| <p>...</p> |
There was a problem hiding this comment.
This article still contains placeholder content (<p>...</p>) in the later sections, which indicates an incomplete generation. Please replace placeholders with full translated text (and ensure wordCount and reading-time metadata match the final content).
| // Gateway returns large payloads via file path | ||
| if (parsed.payloadPath) { | ||
| const fs = await import('fs'); | ||
| const payloadRaw = JSON.parse(fs.readFileSync(parsed.payloadPath, 'utf8')); | ||
| const payloadText = payloadRaw?.content?.[0]?.text; | ||
| if (payloadText) { | ||
| try { return JSON.parse(payloadText); } catch { return { text: payloadText }; } | ||
| } | ||
| return payloadRaw; |
There was a problem hiding this comment.
payloadPath is taken from the server response and passed directly to fs.readFileSync, which allows the server to trigger reads of arbitrary local files accessible to the runner. Restrict reads to an allow-listed directory/prefix (and validate payloadPath is a safe, normalized path) before reading.
| // Handle session initialization error (Streamable HTTP transport) | ||
| if (errorMsg.includes('session initialization')) { | ||
| if (errorMsg.includes('session initialization') || errorMsg.includes('Too Many Requests')) { | ||
| this.sessionId = null; | ||
| if (retryCount === 0) { | ||
| console.warn('⚠️ Session expired, re-initializing...'); | ||
| if (retryCount < 2) { | ||
| const delay = (retryCount + 1) * 2000; | ||
| console.warn(`⚠️ Session error, re-initializing after ${delay}ms...`); | ||
| await new Promise(r => setTimeout(r, delay)); | ||
| await this.initializeSession(); | ||
| return this.request(tool, params, retryCount + 1, skipPrefix); | ||
| } |
There was a problem hiding this comment.
The session error detection checks errorMsg.includes('Too Many Requests'), but errorMsg here is not lowercased (unlike the later retry logic). If the server returns a different casing (e.g. "too many requests"), this branch won’t run and the session won’t be re-initialized. Consider normalizing case (or checking response.status === 429) consistently.
| { | ||
| "timestamp": "2026-02-18T11:30:00.000Z", | ||
| "type": "realtime-monitor", | ||
| "events_detected": { | ||
| "high_significance": [ | ||
| { | ||
| "type": "foreign_policy_debate", | ||
| "id": "HDC120260218ud", | ||
| "title": "Annual Foreign Policy Debate (Utrikespolitisk debatt)", | ||
| "date": "2026-02-18", | ||
| "description": "Annual debate led by Foreign Minister Maria Malmer Stenergard (M) at 09:00" | ||
| }, | ||
| { | ||
| "type": "parliamentary_question", | ||
| "id": "HD11524", | ||
| "title": "Palestinian Authority new constitutional proposal", | ||
| "date": "2026-02-18", | ||
| "party": "SD", | ||
| "target_minister": "Foreign Minister Maria Malmer Stenergard" | ||
| }, | ||
| { | ||
| "type": "parliamentary_question", | ||
| "id": "HD11522", | ||
| "title": "AI use in public sector", | ||
| "date": "2026-02-18", | ||
| "party": "V", | ||
| "target_minister": "Civil Minister Erik Slottner" | ||
| }, | ||
| { | ||
| "type": "parliamentary_question", | ||
| "id": "HD11521", | ||
| "title": "EU-Cuba PDCA agreement", | ||
| "date": "2026-02-18", | ||
| "party": "SD", | ||
| "target_minister": "Trade Minister Benjamin Dousa" | ||
| }, | ||
| { | ||
| "type": "parliamentary_question", | ||
| "id": "HD11523", | ||
| "title": "Öland Bridge infrastructure", | ||
| "date": "2026-02-18", | ||
| "party": "C", | ||
| "target_minister": "Infrastructure Minister Andreas Carlson" | ||
| }, | ||
| { | ||
| "type": "interpellation", | ||
| "id": "HD10342", | ||
| "title": "Security for elite athletes and cultural workers", | ||
| "date": "2026-02-18", | ||
| "party": "S" | ||
| } | ||
| ], | ||
| "medium_significance": [ | ||
| { | ||
| "type": "ministerial_answer", | ||
| "id": "HD12483", | ||
| "title": "Police report against national security advisor", | ||
| "date": "2026-02-18" | ||
| }, | ||
| { | ||
| "type": "ministerial_answer", | ||
| "id": "HD12511", | ||
| "title": "Teenage deportations", | ||
| "date": "2026-02-18" | ||
| }, | ||
| { | ||
| "type": "ministerial_answer", | ||
| "id": "HD12503", | ||
| "title": "Judiciary oversight review", | ||
| "date": "2026-02-18" | ||
| } | ||
| ] | ||
| }, | ||
| "articles_generated": [ | ||
| { | ||
| "slug": "2026-02-18-foreign-policy-debate", | ||
| "languages": ["en", "sv", "da", "no", "fi", "de", "fr", "es", "nl", "ar", "he", "ja", "ko", "zh"], | ||
| "type": "breaking", | ||
| "headline_en": "Sweden's Annual Foreign Policy Debate: Riksdag Takes on Global Challenges" | ||
| } | ||
| ], | ||
| "data_freshness": { | ||
| "mcp_status": "live", | ||
| "mcp_checked_at": "2026-02-18T11:31:47.515Z", | ||
| "sources": ["data.riksdagen.se", "g0v.se"] | ||
| }, | ||
| "next_check": "2026-02-18T14:00:00.000Z" | ||
| "lastGeneration": "2026-02-19T05:30:00Z", | ||
| "articleTypes": ["committee-reports", "government-propositions", "opposition-motions"], | ||
| "languages": ["en","sv","da","no","fi","de","fr","es","nl","ar","he","ja","ko","zh"], | ||
| "articlesGenerated": 42, | ||
| "date": "2026-02-19", | ||
| "source": "riksdag-regering-mcp", | ||
| "forceGeneration": false |
There was a problem hiding this comment.
news/metadata/last-generation.json schema was changed to new keys (e.g., lastGeneration, articlesGenerated), but scripts/generate-news-enhanced.js still writes the old schema (timestamp, types, languagesGenerated, etc.). This will break any consumers expecting a consistent format; either keep the previous schema here or update the generator + any readers to the new schema together.
| <h2>Partijanalyse</h2> | ||
| <p>...</p> | ||
|
|
||
| <h2>Vooruitzichten</h2> | ||
| <p>...</p> |
There was a problem hiding this comment.
This article still contains placeholder content (<p>...</p>) in the later sections, which indicates an incomplete generation. Please replace placeholders with full translated text (and ensure wordCount and reading-time metadata match the final content).
| <h2>政党分析</h2> | ||
| <p>...</p> | ||
|
|
||
| <h2>見通し</h2> | ||
| <p>...</p> |
There was a problem hiding this comment.
This article still contains placeholder content (<p>...</p>) in the later sections, which indicates an incomplete generation. Please replace placeholders with full translated text (and ensure wordCount and reading-time metadata match the final content).
| <h2>ניתוח מפלגתי</h2> | ||
| <p>...</p> | ||
|
|
||
| <h2>תחזית</h2> | ||
| <p>...</p> |
There was a problem hiding this comment.
This article still contains placeholder content (<p>...</p>) in the later sections, which indicates an incomplete generation. Please replace placeholders with full translated text (and ensure wordCount and reading-time metadata match the final content).
| <h2>Analyse des partis</h2> | ||
| <p>...</p> | ||
|
|
||
| <h2>Perspectives</h2> | ||
| <p>...</p> |
There was a problem hiding this comment.
This article still contains placeholder content (<p>...</p>) in the later sections, which indicates an incomplete generation. Please replace placeholders with full translated text (and ensure wordCount and reading-time metadata match the final content).
| // Send notifications/initialized (required by MCP protocol) | ||
| await fetch(this.baseURL, { | ||
| method: 'POST', | ||
| headers: { ...headers, ...(this.sessionId ? { 'Mcp-Session-Id': this.sessionId } : {}) }, | ||
| body: JSON.stringify({ | ||
| jsonrpc: '2.0', | ||
| method: 'notifications/initialized' | ||
| }) | ||
| }); |
There was a problem hiding this comment.
initializeSession() sends notifications/initialized via a second fetch without signal/timeout handling and without checking response.ok. A stalled or failed notification call could hang generation or silently leave the server in an uninitialized state; reuse the AbortController signal and handle non-2xx responses.
|
@copilot open a new pull request to apply changes based on the comments in this thread |
Fix placeholder content, payloadPath security, schema mismatch, and session init robustness
…ot/replace-placeholder-content-opposition-motions
…nt-opposition-motions [WIP] Address review comments and update opposition motions articles
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
News Articles for 2026-02-19
42 articles across 14 languages covering committee reports, government propositions, and opposition motions.
Article Types
Validation