Skip to content

📰 Deep-inspection: Paid police education proposal (2026-03-12)#1080

Merged
pethers merged 10 commits intomainfrom
news/deep-inspection-2026-03-12-betald-polisutbildning-1686e6c8ca78187b
Mar 12, 2026
Merged

📰 Deep-inspection: Paid police education proposal (2026-03-12)#1080
pethers merged 10 commits intomainfrom
news/deep-inspection-2026-03-12-betald-polisutbildning-1686e6c8ca78187b

Conversation

@github-actions
Copy link
Contributor

Deep-Inspection Article: Paid Police Education (Betald Polisutbildning)

Articles Generated

File Lang Quality
2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-en.html EN 94/100 ✅
2026-03-12-deep-inspection-gov-presstraff-om-forslag-om-betal-nxwv0-sv.html SV 88/100 ✅

Topic 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

  • Government: Regeringen.se press release on betald polisutbildning
  • Riksdag: Ds 2025:25, JuU44 committee report, Prop 2025/26:44
  • Parliamentary debates: Protocol 2025/26:72, JuU21 committee report
  • MCP: riksdag-regering-mcp live data (verified via get_sync_status)

Article Features (via script generation)

  • ✅ Multi-stakeholder SWOT analysis
  • ✅ Document Intelligence Dashboard (Chart.js)
  • ✅ Color-coded CSS Mindmap
  • ✅ Schema.org NewsArticle structured data
  • ✅ hreflang tags for SEO
  • ✅ HTMLHint validation passed (0 errors)
  • ✅ Zero untranslated spans

Bug Fix: MCP Auth Token

Fixed mcp-setup.sh and scripts/mcp-client/client.ts — the MCP gateway expects raw API keys, not Bearer-prefixed tokens. This was causing 401 Unauthorized errors in the generation script.

Generated by News: Article Generator (Manual) ·

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>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 66 to 72
// 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;
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 37 to 42
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
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
"@type": "ListItem",
"position": 2,
"name": "Nyheter",
"item": "https://riksdagsmonitor.com/news/index.html"
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"item": "https://riksdagsmonitor.com/news/index.html"
"item": "https://riksdagsmonitor.com/news/index_sv.html"

Copilot uses AI. Check for mistakes.
<span class="separator">•</span>
<span>Analys</span>
<span class="separator">•</span>
<span>1 min read</span>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<span>1 min read</span>
<span>1 min läsning</span>

Copilot uses AI. Check for mistakes.
<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>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<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>

Copilot uses AI. Check for mistakes.
Comment on lines +43 to +55
<!-- 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">
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<!-- 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">

Copilot uses AI. Check for mistakes.
<h2>Document Intelligence Analysis</h2>

<article class="document-entry" data-index="1">
<h3>presstraff om forslag om betald polisutbildning</h3>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<h3>presstraff om forslag om betald polisutbildning</h3>
<h3>Pressträff om förslag om betald polisutbildning</h3>

Copilot uses AI. Check for mistakes.
Comment on lines +209 to +220
<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>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
<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>

Copilot uses AI. Check for mistakes.
Comment on lines +290 to +294
<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="{&quot;type&quot;:&quot;bar&quot;,&quot;data&quot;:{&quot;labels&quot;:[&quot;pressm&quot;],&quot;datasets&quot;:[{&quot;label&quot;:&quot;Documents&quot;,&quot;data&quot;:[1],&quot;backgroundColor&quot;:[&quot;#00d9ff&quot;]}]},&quot;options&quot;:{&quot;plugins&quot;:{&quot;title&quot;:{&quot;display&quot;:true,&quot;text&quot;:&quot;Documents by Type&quot;}}}}"></canvas>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
<h2>Dokumentunderrättelseanalys</h2>

<article class="document-entry" data-index="1">
<h3>presstraff om forslag om betald polisutbildning</h3>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<h3>presstraff om forslag om betald polisutbildning</h3>
<h3>Pressträff om förslag om betald polisutbildning</h3>

Copilot uses AI. Check for mistakes.
@pethers
Copy link
Member

pethers commented Mar 12, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Mar 12, 2026

@pethers I've opened a new pull request, #1081, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits March 12, 2026 11:46
…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, ******
@pethers pethers requested a review from Copilot March 12, 2026 11:52
@github-actions github-actions bot added html-css HTML/CSS changes translation Translation updates refactor Code refactoring news News articles and content generation size-xl Extra large change (> 1000 lines) labels Mar 12, 2026
@github-actions
Copy link
Contributor Author

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

<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'">
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<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">

Copilot uses AI. Check for mistakes.
<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>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<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>

Copilot uses AI. Check for mistakes.
Comment on lines 56 to +58
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'];
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
<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'">
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<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">

Copilot uses AI. Check for mistakes.

<div class="article-content prose">
<p class="lede">
In-depth analysis of 1 parliamentary documents
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.).

Suggested change
In-depth analysis of 1 parliamentary documents
In-depth analysis of 1 parliamentary document

Copilot uses AI. Check for mistakes.
<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>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<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 uses AI. Check for mistakes.
@pethers
Copy link
Member

pethers commented Mar 12, 2026

@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)
TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)Failing after 1m

Copy link
Contributor

Copilot AI commented Mar 12, 2026

@pethers I've opened a new pull request, #1083, to work on those changes. Once the pull request is ready, I'll request review from you.

…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
@pethers pethers requested a review from Copilot March 12, 2026 12:19
@github-actions github-actions bot added the testing Test coverage label Mar 12, 2026
@github-actions
Copy link
Contributor Author

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

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;
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
if (apiKey) return apiKey;
// Strip legacy "Bearer " prefix if present — gateway expects raw API key
if (apiKey) return apiKey.replace(/^Bearer\s+/i, '');

Copilot uses AI. Check for mistakes.
Comment on lines +210 to +225
<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>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
</div>
</footer>

<script type="module" src="../scripts/back-to-top.ts"></script>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
<script type="module" src="../scripts/back-to-top.ts"></script>
<script type="module" src="../js/back-to-top.js"></script>

Copilot uses AI. Check for mistakes.
</div>
</footer>

<script type="module" src="../scripts/back-to-top.ts"></script>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
<script type="module" src="../scripts/back-to-top.ts"></script>
<script type="module" src="../js/back-to-top.js"></script>

Copilot uses AI. Check for mistakes.
@pethers
Copy link
Member

pethers commented Mar 12, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Mar 12, 2026

@pethers I've opened a new pull request, #1084, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits March 12, 2026 12:28
…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
@pethers pethers requested a review from Copilot March 12, 2026 12:52
@github-actions
Copy link
Contributor Author

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment on lines 107 to 111
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 {
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@pethers pethers merged commit 1403394 into main Mar 12, 2026
25 checks passed
@pethers pethers deleted the news/deep-inspection-2026-03-12-betald-polisutbildning-1686e6c8ca78187b branch March 12, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-news html-css HTML/CSS changes needs-editorial-review news News articles and content generation news-generation refactor Code refactoring size-xl Extra large change (> 1000 lines) testing Test coverage translation Translation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants