Conversation
Generate deep-inspection articles (EN/SV) analyzing the government's proposal for paid police education (betald polisutbildning). Articles generated: - 2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-en.html (94/100) - 2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-sv.html (88/100) Bug fix: MCP auth token formatting - mcp-setup.sh: Remove incorrect 'Bearer ' prefix from API key - client.ts: Remove 'Bearer ' prefix from API key resolution The MCP gateway expects raw API keys, not Bearer-prefixed tokens. Sources: regeringen.se press release, Ds 2025:25, JuU44, Prop 2025/26:44 Data: riksdag-regering-mcp live data Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new “deep-inspection” news article pair (EN/SV) about the paid police education proposal and adjusts MCP auth token handling in the generation tooling so the gateway uses raw API keys (not Bearer-prefixed tokens).
Changes:
- Update MCP setup/client auth-token resolution to stop automatically prepending
Bearer. - Add newly generated deep-inspection article pages (EN + SV) plus generation metadata updates.
- Refresh
news/metadata/*status files to reflect the latest generation run.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/mcp-setup.sh | Stops prepending Bearer and exports the MCP auth token “as-is”. |
| scripts/mcp-client/client.ts | Updates auth-token resolution logic/docs to treat MCP gateway tokens as raw API keys. |
| news/metadata/last-generation.json | Records the latest generation run as “deep-inspection”, EN+SV only. |
| news/metadata/batch-status.json | Marks the latest batch as complete for EN+SV only. |
| news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-en.html | New EN deep-inspection article page output. |
| news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-sv.html | New SV deep-inspection article page output. |
| // Priority 3: legacy gateway.apiKey | ||
| const gateway = raw['gateway'] as Record<string, unknown> | undefined; | ||
| const apiKey = gateway?.['apiKey'] as string | undefined; | ||
| if (apiKey) return `Bearer ${apiKey}`; | ||
| if (apiKey) return apiKey; | ||
|
|
||
| // Priority 4: mcpServers['riksdag-regering'].headers.Authorization | ||
| const mcpServers = raw['mcpServers'] as Record<string, unknown> | undefined; |
There was a problem hiding this comment.
The docs for priority 4 say the config's headers.Authorization is a raw API key, but this code returns that value verbatim. If the config still contains a conventional "Bearer ..." value, the behavior differs from the documented/raw-key expectation; either normalize (strip optional "Bearer ") or clarify in the documentation what format is supported.
| if [ -z "$GW_KEY" ]; then | ||
| echo "⚠️ WARNING: MCP config file exists but MCP auth token is missing or invalid" | ||
| else | ||
| # If value already contains "Bearer ", use as-is; otherwise prepend | ||
| case "$GW_KEY" in | ||
| Bearer\ *) export MCP_AUTH_TOKEN="$GW_KEY" ;; | ||
| *) export MCP_AUTH_TOKEN="Bearer $GW_KEY" ;; | ||
| esac | ||
| # Use the key as-is — the MCP gateway expects the raw API key | ||
| export MCP_AUTH_TOKEN="$GW_KEY" | ||
| fi |
There was a problem hiding this comment.
This now exports MCP_AUTH_TOKEN exactly as read from the config. If a user still has a legacy value stored as "Bearer ", that value will be passed through unchanged even though the comment says the gateway expects a raw API key. Consider normalizing by stripping an optional leading "Bearer " to support both legacy and raw formats (or update the extraction docs to clearly state that only raw keys are supported).
| "@type": "ListItem", | ||
| "position": 2, | ||
| "name": "Nyheter", | ||
| "item": "https://riksdagsmonitor.com/news/index.html" |
There was a problem hiding this comment.
I BreadcrumbList (structured data) länkar “Nyheter” till news/index.html (EN) i stället för den svenska nyhetsindex-sidan. För SV-sidor bör detta vara https://riksdagsmonitor.com/news/index_sv.html för korrekt i18n/SEO.
| "item": "https://riksdagsmonitor.com/news/index.html" | |
| "item": "https://riksdagsmonitor.com/news/index_sv.html" |
| <span class="separator">•</span> | ||
| <span>Analys</span> | ||
| <span class="separator">•</span> | ||
| <span>1 min read</span> |
There was a problem hiding this comment.
Det finns kvar engelska UI-texter i den svenska versionen (t.ex. “1 min read”). Detta ser ut som en ofullständig lokalisering; byt till svensk text (t.ex. “1 min läsning”) och säkerställ att övriga dashboard-/mindmap-etiketter också är översatta.
| <span>1 min read</span> | |
| <span>1 min läsning</span> |
| <article class="document-entry" data-index="1"> | ||
| <h3>presstraff om forslag om betald polisutbildning</h3> | ||
| <p class="doc-meta"><span class="doc-type">Pressmeddelande</span> · <code>gov-presstraff-om-forslag-om-betal-nxwv00s</code> · <time datetime="2026-03-12">2026-03-12</time> · <em>utbildningspolitik, rättspolitik</em></p> | ||
| <div class="doc-analysis"># Pressträff om förslag om betald polisutbildning [Anmälningsformulär till pressträff den 12 mars - extern webbplats,](https://www.lyyti.in/Presstrff_den_12_mars_0610) [Anmälningsformulär till pressträff den 12 mars - extern webbplats,](https://www.lyyti.in/Presstrff_den_12_mars_0610) Berör utbildningspolitik, rättspolitik. Utbildningspropositioner måste balansera nationella läroplaner med kommunalt leveransansvar och de privata aktörernas omstridda roll.</div> |
There was a problem hiding this comment.
doc-analysis verkar innehålla rå Markdown (inledande # och [text](url)-syntax) och länken upprepas två gånger. I HTML-rendering kommer detta visas bokstavligt och ger duplicerat innehåll; konvertera till riktig HTML och ta bort dubblettlänken.
| <div class="doc-analysis"># Pressträff om förslag om betald polisutbildning [Anmälningsformulär till pressträff den 12 mars - extern webbplats,](https://www.lyyti.in/Presstrff_den_12_mars_0610) [Anmälningsformulär till pressträff den 12 mars - extern webbplats,](https://www.lyyti.in/Presstrff_den_12_mars_0610) Berör utbildningspolitik, rättspolitik. Utbildningspropositioner måste balansera nationella läroplaner med kommunalt leveransansvar och de privata aktörernas omstridda roll.</div> | |
| <div class="doc-analysis">Pressträff om förslag om betald polisutbildning. <a href="https://www.lyyti.in/Presstrff_den_12_mars_0610">Anmälningsformulär till pressträff den 12 mars - extern webbplats</a>. Berör utbildningspolitik, rättspolitik. Utbildningspropositioner måste balansera nationella läroplaner med kommunalt leveransansvar och de privata aktörernas omstridda roll.</div> |
| <!-- Hreflang for language alternatives --> | ||
| <link rel="alternate" hreflang="en" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-en.html"> | ||
| <link rel="alternate" hreflang="sv" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-sv.html"> | ||
| <link rel="alternate" hreflang="da" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-da.html"> | ||
| <link rel="alternate" hreflang="nb" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-no.html"> | ||
| <link rel="alternate" hreflang="fi" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-fi.html"> | ||
| <link rel="alternate" hreflang="de" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-de.html"> | ||
| <link rel="alternate" hreflang="fr" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-fr.html"> | ||
| <link rel="alternate" hreflang="es" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-es.html"> | ||
| <link rel="alternate" hreflang="nl" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-nl.html"> | ||
| <link rel="alternate" hreflang="ar" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-ar.html"> | ||
| <link rel="alternate" hreflang="he" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-he.html"> | ||
| <link rel="alternate" hreflang="ja" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-ja.html"> |
There was a problem hiding this comment.
This page declares hreflang alternates for many languages (da/nb/fi/…/zh), but this PR only adds EN+SV variants of the deep-inspection article (see news/metadata/last-generation.json). Those alternate URLs will 404 and create broken internal links/SEO signals. Limit hreflang (and the language switcher links) to the actually generated language files for this article, or ensure the referenced language pages are also generated and committed.
| <!-- Hreflang for language alternatives --> | |
| <link rel="alternate" hreflang="en" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-en.html"> | |
| <link rel="alternate" hreflang="sv" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-sv.html"> | |
| <link rel="alternate" hreflang="da" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-da.html"> | |
| <link rel="alternate" hreflang="nb" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-no.html"> | |
| <link rel="alternate" hreflang="fi" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-fi.html"> | |
| <link rel="alternate" hreflang="de" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-de.html"> | |
| <link rel="alternate" hreflang="fr" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-fr.html"> | |
| <link rel="alternate" hreflang="es" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-es.html"> | |
| <link rel="alternate" hreflang="nl" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-nl.html"> | |
| <link rel="alternate" hreflang="ar" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-ar.html"> | |
| <link rel="alternate" hreflang="he" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-he.html"> | |
| <link rel="alternate" hreflang="ja" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-ja.html"> | |
| <!-- Hreflang for language alternatives (only existing variants) --> | |
| <link rel="alternate" hreflang="en" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-en.html"> | |
| <link rel="alternate" hreflang="sv" href="https://riksdagsmonitor.com/news/2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-sv.html"> |
| <h2>Document Intelligence Analysis</h2> | ||
|
|
||
| <article class="document-entry" data-index="1"> | ||
| <h3>presstraff om forslag om betald polisutbildning</h3> |
There was a problem hiding this comment.
The document title in the entry is misspelled/lowercased (“presstraff om forslag …”). For readability (and consistency with the text below), render the proper Swedish title with correct capitalization and diacritics.
| <h3>presstraff om forslag om betald polisutbildning</h3> | |
| <h3>Pressträff om förslag om betald polisutbildning</h3> |
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-da.html" class="lang-link" hreflang="da">🇩🇰 Dansk</a> | ||
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-no.html" class="lang-link" hreflang="nb">🇳🇴 Norsk</a> | ||
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-fi.html" class="lang-link" hreflang="fi">🇫🇮 Suomi</a> | ||
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-de.html" class="lang-link" hreflang="de">🇩🇪 Deutsch</a> | ||
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-fr.html" class="lang-link" hreflang="fr">🇫🇷 Français</a> | ||
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-es.html" class="lang-link" hreflang="es">🇪🇸 Español</a> | ||
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-nl.html" class="lang-link" hreflang="nl">🇳🇱 Nederlands</a> | ||
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-ar.html" class="lang-link" hreflang="ar">🇸🇦 العربية</a> | ||
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-he.html" class="lang-link" hreflang="he">🇮🇱 עברית</a> | ||
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-ja.html" class="lang-link" hreflang="ja">🇯🇵 日本語</a> | ||
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-ko.html" class="lang-link" hreflang="ko">🇰🇷 한국어</a> | ||
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-zh.html" class="lang-link" hreflang="zh">🇨🇳 中文</a> |
There was a problem hiding this comment.
The language switcher links to non-existent deep-inspection translations (da/no/fi/…/zh) in this PR. Users will hit 404s when clicking these. Only render links for languages that have corresponding files in the repo for this article (or generate the missing pages).
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-da.html" class="lang-link" hreflang="da">🇩🇰 Dansk</a> | |
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-no.html" class="lang-link" hreflang="nb">🇳🇴 Norsk</a> | |
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-fi.html" class="lang-link" hreflang="fi">🇫🇮 Suomi</a> | |
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-de.html" class="lang-link" hreflang="de">🇩🇪 Deutsch</a> | |
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-fr.html" class="lang-link" hreflang="fr">🇫🇷 Français</a> | |
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-es.html" class="lang-link" hreflang="es">🇪🇸 Español</a> | |
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-nl.html" class="lang-link" hreflang="nl">🇳🇱 Nederlands</a> | |
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-ar.html" class="lang-link" hreflang="ar">🇸🇦 العربية</a> | |
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-he.html" class="lang-link" hreflang="he">🇮🇱 עברית</a> | |
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-ja.html" class="lang-link" hreflang="ja">🇯🇵 日本語</a> | |
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-ko.html" class="lang-link" hreflang="ko">🇰🇷 한국어</a> | |
| <a href="2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-zh.html" class="lang-link" hreflang="zh">🇨🇳 中文</a> |
| <div id="article-dashboard" class="article-dashboard-section"><section class="article-dashboard" aria-label="Document Intelligence Dashboard"> | ||
| <h2>Document Intelligence Dashboard</h2> | ||
| <p class="dashboard-summary">1 parliamentary documents analysed</p> | ||
| <div class="dashboard-chart-wrapper"> | ||
| <canvas id="deep-inspection-doc-types" role="img" aria-label="Documents by Type" data-chart-config="{"type":"bar","data":{"labels":["pressm"],"datasets":[{"label":"Documents","data":[1],"backgroundColor":["#00d9ff"]}]},"options":{"plugins":{"title":{"display":true,"text":"Documents by Type"}}}}"></canvas> |
There was a problem hiding this comment.
Dashboard-sektionen innehåller engelska rubriker och sammanfattningar (“Document Intelligence Dashboard”, “1 parliamentary documents analysed”, etc.). För SV-sidan bör dessa strängar vara konsekvent på svenska (och gärna också lokalisera aria-labels/diagram-etiketter).
| <h2>Dokumentunderrättelseanalys</h2> | ||
|
|
||
| <article class="document-entry" data-index="1"> | ||
| <h3>presstraff om forslag om betald polisutbildning</h3> |
There was a problem hiding this comment.
Dokumenttiteln i listan är felstavad/lägrecased (“presstraff om forslag …”). För läsbarhet bör detta återges som korrekt svensk titel med rätt versalisering och diakritiska tecken.
| <h3>presstraff om forslag om betald polisutbildning</h3> | |
| <h3>Pressträff om förslag om betald polisutbildning</h3> |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
…g switchers, Bearer prefix Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Fix deep-inspection article quality: titles, i18n, CSP hashes, doc-analysis markup, lang switchers, ******
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
| <link rel="preconnect" href="https://fonts.googleapis.com"> | ||
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet"> | ||
| <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500;600;700&family=Share+Tech+Mono&display=swap" media="print" onload="this.media='all'"> |
There was a problem hiding this comment.
This page includes a with an inline onload handler (media="print" onload=...), but the page CSP does not allow inline event handlers (no 'unsafe-inline' / no script-src-attr hashes). That typically causes the onload handler to be blocked, so the Orbitron/Share Tech Mono stylesheet may never switch to media="all". Prefer a plain rel="stylesheet" link (as used for Inter) or adjust CSP accordingly.
| <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500;600;700&family=Share+Tech+Mono&display=swap" media="print" onload="this.media='all'"> | |
| <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500;600;700&family=Share+Tech+Mono&display=swap"> |
| <div class="swot-quadrant swot-strengths"> | ||
| <h4>Styrkor</h4> | ||
| <ul> | ||
| <li>presstraff om forslag om betald polisutbildning <span class="swot-impact swot-impact--high">[Hög]</span></li> |
There was a problem hiding this comment.
The SWOT bullet text appears to be a lossy/ASCII-lowercased version of the document title ("presstraff om forslag om betald polisutbildning"). Since this is reader-facing content, it should preserve capitalization and Swedish characters (e.g., "Pressträff om förslag om betald polisutbildning") for readability and professionalism.
| <li>presstraff om forslag om betald polisutbildning <span class="swot-impact swot-impact--high">[Hög]</span></li> | |
| <li>Pressträff om förslag om betald polisutbildning <span class="swot-impact swot-impact--high">[Hög]</span></li> |
| function getDefaultAuthToken(): string { | ||
| if (process.env['MCP_AUTH_TOKEN']) return process.env['MCP_AUTH_TOKEN']; | ||
| if (process.env['MCP_GATEWAY_API_KEY']) return `Bearer ${process.env['MCP_GATEWAY_API_KEY']}`; | ||
| if (process.env['MCP_GATEWAY_API_KEY']) return process.env['MCP_GATEWAY_API_KEY']; |
There was a problem hiding this comment.
getDefaultAuthToken() returns MCP_AUTH_TOKEN env var as-is, but the rest of the function strips a legacy "Bearer " prefix. If someone still exports MCP_AUTH_TOKEN="Bearer ", the client will send the prefix and likely keep failing auth. Consider normalizing MCP_AUTH_TOKEN the same way (strip /^Bearer\s+/i) or update the contract to explicitly require a raw key.
| <link rel="preconnect" href="https://fonts.googleapis.com"> | ||
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet"> | ||
| <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500;600;700&family=Share+Tech+Mono&display=swap" media="print" onload="this.media='all'"> |
There was a problem hiding this comment.
This page includes a with an inline onload handler (media="print" onload=...), but the page CSP does not allow inline event handlers (no 'unsafe-inline' / no script-src-attr hashes). That typically causes the onload handler to be blocked, so the Orbitron/Share Tech Mono stylesheet may never switch to media="all". Prefer a plain rel="stylesheet" link (as used for Inter) or adjust CSP accordingly.
| <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500;600;700&family=Share+Tech+Mono&display=swap" media="print" onload="this.media='all'"> | |
| <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500;600;700&family=Share+Tech+Mono&display=swap"> |
|
|
||
| <div class="article-content prose"> | ||
| <p class="lede"> | ||
| In-depth analysis of 1 parliamentary documents |
There was a problem hiding this comment.
Several visible strings use an incorrect singular/plural form (e.g., "In-depth analysis of 1 parliamentary documents"). Since the count is 1, these should be singular ("document") and updated consistently wherever they appear (lede text, OG/Twitter descriptions, dashboard summary, etc.).
| In-depth analysis of 1 parliamentary documents | |
| In-depth analysis of 1 parliamentary document |
| <div class="swot-quadrant swot-strengths"> | ||
| <h4>Strengths</h4> | ||
| <ul> | ||
| <li>presstraff om forslag om betald polisutbildning <span class="swot-impact swot-impact--high">[High]</span></li> |
There was a problem hiding this comment.
The SWOT bullet text appears to be a lossy/ASCII-lowercased version of the document title ("presstraff om forslag om betald polisutbildning"). Since this is reader-facing content, it should preserve capitalization and Swedish characters (e.g., "Pressträff om förslag om betald polisutbildning") for readability and professionalism.
| <li>presstraff om forslag om betald polisutbildning <span class="swot-impact swot-impact--high">[High]</span></li> | |
| <li>Pressträff om förslag om betald polisutbildning <span class="swot-impact swot-impact--high">[High]</span></li> |
|
@copilot open a new pull request to apply changes based on the comments in this thread and TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request) |
…var, fix font CSP, singular form, SWOT text Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Fix review feedback: tests, auth token normalization, font CSP, i18n corrections
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
scripts/mcp-client/client.ts
Outdated
| const gateway = raw['gateway'] as Record<string, unknown> | undefined; | ||
| const apiKey = gateway?.['apiKey'] as string | undefined; | ||
| if (apiKey) return `Bearer ${apiKey}`; | ||
| if (apiKey) return apiKey; |
There was a problem hiding this comment.
getDefaultAuthToken() claims it strips legacy Bearer <key> values stored in the MCP config, but the gateway.apiKey branch returns the value as-is. If an older config has gateway.apiKey: "Bearer …", this will still produce an invalid token and reintroduce 401s. Strip the Bearer prefix for gateway.apiKey as well (same logic used for MCP_AUTH_TOKEN / Authorization).
| if (apiKey) return apiKey; | |
| // Strip legacy "Bearer " prefix if present — gateway expects raw API key | |
| if (apiKey) return apiKey.replace(/^Bearer\s+/i, ''); |
| <div class="hero-header-text"> | ||
| <h1>Djupanalys: Betald polisutbildning</h1> | ||
| <div class="site-tagline">Senaste nyheter och analyser från Sveriges riksdag. AI-genererad politisk underrättelsejournalistik baserad på OSINT/INTOP-data som bevakar riksdagen, regeringen och myndigheter med systematisk transparens.</div> | ||
| </div> | ||
| <a href="index_sv.html" aria-label="Riksdagsmonitor News"> | ||
| <img src="../images/riksdagsmonitornews-logo.webp" alt="Riksdagsmonitor News" class="article-site-logo" width="100" height="100" loading="eager"> | ||
| </a> | ||
| <div class="site-tagline">Senaste nyheter och analyser från Sveriges riksdag. AI-genererad politisk underrättelsejournalistik baserad på OSINT/INTOP-data som bevakar riksdagen, regeringen och myndigheter med systematisk transparens.</div> | ||
| <h1>Djupanalys: Betald polisutbildning</h1> | ||
| <div class="article-meta"> | ||
| <time datetime="2026-03-12">12 mars 2026</time> | ||
| <span class="separator">•</span> | ||
| <span>Analys</span> | ||
| <span class="separator">•</span> | ||
| <span>1 min läsning</span> | ||
| </div> |
There was a problem hiding this comment.
This generated page contains two <h1> elements with the same text in the header. Multiple H1s on a single article page is problematic for accessibility and document structure (screen readers / outline). Keep a single <h1> for the article title and convert the duplicate to a non-heading element or remove it.
| </div> | ||
| </footer> | ||
|
|
||
| <script type="module" src="../scripts/back-to-top.ts"></script> |
There was a problem hiding this comment.
The page includes ../scripts/back-to-top.ts as a browser module. Other news pages reference the built JS asset (../js/back-to-top.js), and serving a .ts file directly is likely to fail on GitHub Pages (incorrect MIME type / untranspiled TypeScript). Update the reference to the compiled JS file (or ensure the generator outputs the same back-to-top script reference used by other articles).
| <script type="module" src="../scripts/back-to-top.ts"></script> | |
| <script type="module" src="../js/back-to-top.js"></script> |
| </div> | ||
| </footer> | ||
|
|
||
| <script type="module" src="../scripts/back-to-top.ts"></script> |
There was a problem hiding this comment.
The page includes ../scripts/back-to-top.ts as a browser module. Other news pages reference the built JS asset (../js/back-to-top.js), and serving a .ts file directly is likely to fail on GitHub Pages (incorrect MIME type / untranspiled TypeScript). Update the reference to the compiled JS file (or ensure the generator outputs the same back-to-top script reference used by other articles).
| <script type="module" src="../scripts/back-to-top.ts"></script> | |
| <script type="module" src="../js/back-to-top.js"></script> |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
…ip Bearer from gateway.apiKey, fix singular/plural Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Fix review feedback: duplicate H1, back-to-top.ts ref, ****** stripping, singular/plural
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
| const { getDefaultClient } = await import('../scripts/mcp-client.js'); | ||
| const gwClient = getDefaultClient(); | ||
|
|
||
| expect(gwClient.authToken).toBe('Bearer test-gw-key-123'); | ||
| expect(gwClient.authToken).toBe('test-gw-key-123'); | ||
| } finally { |
There was a problem hiding this comment.
The auth-token normalization change (stripping a legacy Bearer prefix) is only indirectly covered via config-file header tests. Please add a dedicated test case covering MCP_AUTH_TOKEN='Bearer <key>' to ensure the new env-var behavior stays stable.
Deep-Inspection Article: Paid Police Education (Betald Polisutbildning)
Articles Generated
2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-en.html2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-sv.htmlTopic Analysis
Government press conference (March 12, 2026) on the proposal for paid police education — a key policy to reach EU-average police density (341 officers per 100,000 residents vs Sweden's current ~237). Based on Ds 2025:25 investigation proposing student loan write-off after 3+ years of police service.
Data Sources
get_sync_status)Article Features (via script generation)
Bug Fix: MCP Auth Token
Fixed
mcp-setup.shandscripts/mcp-client/client.ts— the MCP gateway expects raw API keys, notBearer-prefixed tokens. This was causing 401 Unauthorized errors in the generation script.