Skip to content

Address PR review comments: fix translation script logic and HTML validation issues#312

Merged
pethers merged 14 commits intomainfrom
copilot/enhance-government-propositions-articles
Feb 19, 2026
Merged

Address PR review comments: fix translation script logic and HTML validation issues#312
pethers merged 14 commits intomainfrom
copilot/enhance-government-propositions-articles

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

Government Propositions Enhancement - All Review Comments Addressed ✅

🎉 Third Review Round Complete

All 3 review comments from review 3823320546 have been addressed.

✅ Fixed in This Commit

1. Robust JSON-LD Description Replacement (comment 2825469316)

Problem: Fragile assumption that next @type appears within 100 characters of NewsArticle start.

Solution: Implemented proper brace-counting algorithm to find exact NewsArticle object boundaries:

// Find NewsArticle object start
const newsArticleObjectStart = translated.lastIndexOf('{', newsArticleTypeIndex);

// Count braces to find object end
let depth = 0;
for (let i = newsArticleObjectStart; i < translated.length; i++) {
  if (translated[i] === '{') depth++;
  else if (translated[i] === '}') {
    depth--;
    if (depth === 0) {
      newsArticleObjectEnd = i;
      break;
    }
  }
}

This approach:

  • Handles any JSON-LD structure/ordering
  • No arbitrary 100-char offset
  • Robust bounds checking
  • Works regardless of property count or whitespace

2. Removed articleBody from 2026-02-17 (comment 2825504156)

File: news/2026-02-17-government-propositions-en.html:107

Removed truncated/outdated articleBody field for consistency with other enhanced proposition files (2026-02-14, 2026-02-16, 2026-02-18).

3. Deleted Unauthorized Documentation Files (comment 2825504144)

Removed 3 markdown files created without explicit request:

  • PROPOSITION_ENHANCEMENT_PLAN.md
  • ENHANCEMENT_SUMMARY.md
  • BEFORE_AFTER_COMPARISON.md

Reason: Violates repository guideline (CodingGuidelineID: 1000000): "Never Create New Markdown Files (Unless Explicitly Requested)". Should update existing documentation or add sections to existing files instead.

📊 Complete Review Summary

First Review (5 comments) - Fixed in commit 65ac23d

  • Removed incorrect Swedish file with English metadata
  • Fixed hardcoded GitHub Actions path
  • Documented translation limitations
  • Fixed hardcoded date pattern
  • Clarified file inclusion discrepancy

Second Review (11 comments) - Fixed in commit 914a6ab

  • Removed duplicate paragraph + missing </p> tags
  • Removed inaccurate JSON-LD articleBody (2026-02-16)
  • Fixed garbled markdown heading
  • Fixed language switcher logic
  • Fixed JSON-LD description scope
  • Removed ORIGINAL backup file

Third Review (3 comments) - Fixed in this commit ✅

  • Robust JSON-LD description replacement with brace counting
  • Removed articleBody from 2026-02-17
  • Deleted unauthorized markdown documentation files

✅ All Issues Resolved

Total review comments addressed: 19 (5 + 11 + 3)
Status: All review feedback implemented ✅

Original prompt

This section details on the original issue you should resolve

<issue_title>Enhance Government Propositions Articles with Full Policy Analysis and Legislative Context (All 2026 Dates)</issue_title>
<issue_description># 📋 Issue Type
Enhancement / Content Generation

🎯 Objective

Transform all incomplete government propositions articles (all 2026 dates) from simple link lists into comprehensive analytical articles with full data analysis, policy context, and legislative significance using riksdagen/regering MCP data.

📊 Current State

Articles Affected: ~58 articles (multiple dates × 14 languages)

  • Pattern: news/2026-*-government-propositions-{lang}.html
  • Current Content: Link lists with minimal descriptions like "Government proposal to Parliament"
  • Missing: Policy analysis, political context, legislative strategy, coalition implications
  • Title Issue: Generic "Government Propositions: Policy Priorities This Week" repeated
  • Description Issue: Generic "Analysis of 10 government propositions shaping the legislative agenda" - not content-specific

Example Current State (2026-02-18-government-propositions-en.html):

<h3>A new weapons law</h3>
<p><strong>Document:</strong> <a href="...">HD03141</a></p>
<p>Government proposal to Parliament.</p>

Issues:

  • ❌ No policy analysis or implementation details
  • ❌ No coalition strategy context
  • ❌ No political significance explained
  • ❌ No legislative timeline or expected opposition
  • ❌ Generic boilerplate text
  • ❌ Same title/description across all dates

🚀 Desired State

Rich analytical articles with:

  • Policy analysis: 200-400 words per proposition with implementation details, budget implications, affected stakeholders
  • Political context: Coalition dynamics, expected opposition, negotiation strategy
  • Legislative significance: Why this matters, precedent, EU alignment, policy domain priorities
  • Implementation timeline: Expected chamber debate, voting schedule, enforcement dates
  • Cross-proposition patterns: Government priorities, budget allocation, policy coherence
  • Content-based titles: E.g., "New Weapons Law and VAT Fraud Measures Dominate Government Agenda"
  • Specific descriptions: Reference key propositions and policy areas
  • 14-language completeness: Fully translated analysis

Example Enhanced Content:

<h3>A new weapons law</h3>
<p><strong>Document:</strong> <a href="...">HD03141</a></p>
<p>The government proposes sweeping reforms to Sweden's weapons legislation, introducing stricter licensing requirements and expanded police surveillance powers in response to gang-related violence. The proposal represents a rare convergence between the Tidö coalition and Sweden Democrats, though the Liberals' support remains conditional on enhanced judicial oversight provisions.</p>
<p><strong>Key Points:</strong></p>
<ul>
  <li>Tightens licensing standards for semi-automatic weapons</li>
  <li>Extends police database access for threat assessments</li>
  <li>Implementation: January 2027 pending chamber approval</li>
  <li>Expected debate: March 2-4, 2026</li>
  <li>Coalition consensus (M+KD+L+SD support anticipated)</li>
  <li>Opposition concern: civil liberties and proportionality</li>
</ul>
<p>This marks the third major law-and-order initiative this session, signaling the government's prioritization of crime reduction ahead of the 2026 election.</p>

🔧 Implementation Approach

MCP Data Collection

// For each proposition:
riksdag-regering-get_dokument({
  dok_id: "HD03141",
  include_full_text: true
})

// Get related propositions:
riksdag-regering-search_dokument({
  doktyp: "prop",
  rm: "2025/26"
})

// Find related committee work:
riksdag-regering-search_dokument({
  relaterat_id: "HD03141"
})

Content Enhancement

For each proposition:

  1. Fetch full details (title, summary, minister, budget impact)
  2. Analyze policy content (what changes, who's affected, why now)
  3. Assess political dynamics (coalition support, opposition stance, SD role)
  4. Identify legislative path (committee assignment, debate schedule, voting timeline)
  5. Generate comprehensive analysis (200-400 words)

For each article:

  1. Generate thematic title based on actual propositions
  2. Write specific lede highlighting key proposals
  3. Add cross-cutting analysis on government priorities
  4. Create "What to Watch" section with legislative timeline
  5. Update all metadata to match content

✅ Acceptance Criteria

Content Quality

  • Each proposition has 200-400 word analysis (not generic text)
  • Policy details explained (what changes, impact, stakeholders)
  • Political context identified (coalition dynamics, opposition stance)
  • Legislative timeline specified (committee, debate, vote dates)
  • Cross-cutting analysis on government priorities
  • **"What to Watch" sectio...

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits February 18, 2026 20:55
…(POC)

- Transform generic link list into comprehensive 3,551-word analytical article
- Add unique title: 'Weapons Law and VAT Fraud: Tidö Priorities This Week'
- Provide 200-400 word analysis per proposition (10 total)
- Include policy details, political context, implementation timelines
- Add cross-cutting analysis on government strategic priorities
- Create 'What to Watch' section with forward-looking insights
- Update all metadata (Schema.org, OG, Twitter Card)
- Pass HTML validation (htmlhint)

Proof-of-concept for enhancing 58 government propositions articles.
See PROPOSITION_ENHANCEMENT_PLAN.md for full implementation roadmap.

Content quality matches 2026-02-13-evening-analysis-en.html reference.
5x word count increase demonstrates feasibility of comprehensive analysis.
- Document proof-of-concept achievements
- Provide complete implementation roadmap
- Detail MCP data integration approach
- Outline translation strategy options
- Track progress metrics (1.7% complete)

Ready for Phase 1 continuation in next session.
- Demonstrate 5x word count increase (711 → 3,551 words)
- Showcase quality improvements (generic → analytical)
- Document SEO enhancements (unique titles, specific descriptions)
- Compare content structures (3 sections → 11 sections)
- Outline replication template for remaining 57 articles

Visual proof of concept success and transformation impact.
…h comprehensive documentation

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance government propositions articles with full policy analysis Proof-of-concept: Transform government propositions articles from link lists to comprehensive policy analysis Feb 18, 2026
Copilot AI requested a review from pethers February 18, 2026 21:02
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions bot added documentation Documentation updates html-css HTML/CSS changes javascript JavaScript code changes refactor Code refactoring news News articles and content generation size-xl Extra large change (> 1000 lines) labels Feb 18, 2026
@github-actions
Copy link
Contributor

🔍 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

…nced

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot AI changed the title Proof-of-concept: Transform government propositions articles from link lists to comprehensive policy analysis Transform government propositions articles from link lists to comprehensive policy analysis Feb 19, 2026
@github-actions
Copy link
Contributor

🔍 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

Copilot AI changed the title Transform government propositions articles from link lists to comprehensive policy analysis Address PR review comments: fix translation script logic and HTML validation issues Feb 19, 2026
@github-actions
Copy link
Contributor

🔍 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


// Update language switcher active state
// Remove 'active' from the English link without changing its href
const removeEnActivePattern = new RegExp(`(<a href="${datePattern}-government-propositions-en\\.html" class="lang-link) active"`, 'g');

Check failure

Code scanning / CodeQL

Regular expression injection High

This regular expression is constructed from a
command-line argument
.

Copilot Autofix

AI about 17 hours ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

`$1"`
);
// Add 'active' to the current target language link without changing its href
const addTargetActivePattern = new RegExp(`(<a href="${datePattern}-government-propositions-${targetLang}\\.html" class="lang-link)(?! active")`, 'g');

Check failure

Code scanning / CodeQL

Regular expression injection High

This regular expression is constructed from a
command-line argument
.

Copilot Autofix

AI about 17 hours ago

In general, to fix regular expression injection you must ensure that any untrusted data interpolated into a regex pattern is first escaped so that it is treated as literal text, not as regex syntax. In Node.js, a common approach is to use a library function like _.escapeRegExp from lodash, or to implement a small local helper that replaces all regex metacharacters with escaped versions (e.g., replacing . with \.).

For this script, the only tainted value entering a RegExp is datePattern in the patterns on lines 627, 633, and 646. Although datePattern is currently constrained to a date format, we can make the code robust and satisfy CodeQL by escaping datePattern before embedding it into any regex templates. To avoid adding external dependencies across the project, we can define a small local helper function escapeRegExp near the other top-level constants in scripts/translate-propositions.cjs. This helper will escape all regex metacharacters. We then replace uses of datePattern inside new RegExp(...) with an escaped variant, say escapedDatePattern.

Concretely:

  • Add a function escapeRegExp(string) near the top of the file (after the existing require calls) that escapes [-\/\\^$*+?.()|[\]{}].
  • After computing datePattern on line 623, compute const escapedDatePattern = escapeRegExp(datePattern);.
  • In the three new RegExp calls (lines 627, 633, and 646), interpolate escapedDatePattern instead of datePattern.
  • No behavior change occurs for properly formatted dates (which do not contain regex metacharacters apart from - that is safely escaped), but the code becomes safe even if the filename format changes or is misused.
Suggested changeset 1
scripts/translate-propositions.cjs

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/scripts/translate-propositions.cjs b/scripts/translate-propositions.cjs
--- a/scripts/translate-propositions.cjs
+++ b/scripts/translate-propositions.cjs
@@ -25,6 +25,11 @@
 const fs = require('fs');
 const path = require('path');
 
+// Escape special characters in a string to be used as a literal in a RegExp
+function escapeRegExp(string) {
+  return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+}
+
 // Translation dictionaries for all 14 languages
 const translations = {
   sv: {
@@ -621,16 +626,17 @@
   // e.g., "2026-02-18" from "2026-02-18-government-propositions-en.html"
   const dateMatch = path.basename(sourceFile).match(/(\d{4}-\d{2}-\d{2})/);
   const datePattern = dateMatch ? dateMatch[1] : '2026-02-18'; // fallback if no date found
+  const escapedDatePattern = escapeRegExp(datePattern);
   
   // Update language switcher active state
   // Remove 'active' from the English link without changing its href
-  const removeEnActivePattern = new RegExp(`(<a href="${datePattern}-government-propositions-en\\.html" class="lang-link) active"`, 'g');
+  const removeEnActivePattern = new RegExp(`(<a href="${escapedDatePattern}-government-propositions-en\\.html" class="lang-link) active"`, 'g');
   translated = translated.replace(
     removeEnActivePattern,
     `$1"`
   );
   // Add 'active' to the current target language link without changing its href
-  const addTargetActivePattern = new RegExp(`(<a href="${datePattern}-government-propositions-${targetLang}\\.html" class="lang-link)(?! active")`, 'g');
+  const addTargetActivePattern = new RegExp(`(<a href="${escapedDatePattern}-government-propositions-${targetLang}\\.html" class="lang-link)(?! active")`, 'g');
   translated = translated.replace(
     addTargetActivePattern,
     `$1 active"`
@@ -643,7 +641,7 @@
   );
   
   // Update canonical in URLs
-  const urlPattern = new RegExp(`(${datePattern}-government-propositions-)en(\\.html)`, 'g');
+  const urlPattern = new RegExp(`(${escapedDatePattern}-government-propositions-)en(\\.html)`, 'g');
   translated = translated.replace(urlPattern, `$1${targetLang}$2`);
   
   // Write output
EOF
@@ -25,6 +25,11 @@
const fs = require('fs');
const path = require('path');

// Escape special characters in a string to be used as a literal in a RegExp
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}

// Translation dictionaries for all 14 languages
const translations = {
sv: {
@@ -621,16 +626,17 @@
// e.g., "2026-02-18" from "2026-02-18-government-propositions-en.html"
const dateMatch = path.basename(sourceFile).match(/(\d{4}-\d{2}-\d{2})/);
const datePattern = dateMatch ? dateMatch[1] : '2026-02-18'; // fallback if no date found
const escapedDatePattern = escapeRegExp(datePattern);

// Update language switcher active state
// Remove 'active' from the English link without changing its href
const removeEnActivePattern = new RegExp(`(<a href="${datePattern}-government-propositions-en\\.html" class="lang-link) active"`, 'g');
const removeEnActivePattern = new RegExp(`(<a href="${escapedDatePattern}-government-propositions-en\\.html" class="lang-link) active"`, 'g');
translated = translated.replace(
removeEnActivePattern,
`$1"`
);
// Add 'active' to the current target language link without changing its href
const addTargetActivePattern = new RegExp(`(<a href="${datePattern}-government-propositions-${targetLang}\\.html" class="lang-link)(?! active")`, 'g');
const addTargetActivePattern = new RegExp(`(<a href="${escapedDatePattern}-government-propositions-${targetLang}\\.html" class="lang-link)(?! active")`, 'g');
translated = translated.replace(
addTargetActivePattern,
`$1 active"`
@@ -643,7 +641,7 @@
);

// Update canonical in URLs
const urlPattern = new RegExp(`(${datePattern}-government-propositions-)en(\\.html)`, 'g');
const urlPattern = new RegExp(`(${escapedDatePattern}-government-propositions-)en(\\.html)`, 'g');
translated = translated.replace(urlPattern, `$1${targetLang}$2`);

// Write output
Copilot is powered by AI and may make mistakes. Always verify output.
);

// Update canonical in URLs
const urlPattern = new RegExp(`(${datePattern}-government-propositions-)en(\\.html)`, 'g');

Check failure

Code scanning / CodeQL

Regular expression injection High

This regular expression is constructed from a
command-line argument
.

Copilot Autofix

AI about 17 hours ago

General fix: when constructing a regular expression from any value derived from user input (including command-line arguments), ensure that the interpolated portion is either (a) strictly validated to conform to a safe, limited character set, or (b) passed through a regex-escaping function so any metacharacters lose special meaning.

Best fix here without changing functionality: keep the existing extraction of the date from the filename, but add a validation step to ensure datePattern really is a valid YYYY-MM-DD date consisting only of digits and dashes. If validation fails, fall back to the existing hard-coded default ('2026-02-18'). This guarantees that datePattern is safe to embed into the regex and silences the CodeQL concern while preserving current behavior for valid inputs. We do not need external libraries; a simple additional RegExp test on datePattern suffices.

Concretely, in scripts/translate-propositions.cjs:

  • Replace the current two lines:
622:   const dateMatch = path.basename(sourceFile).match(/(\d{4}-\d{2}-\d{2})/);
623:   const datePattern = dateMatch ? dateMatch[1] : '2026-02-18'; // fallback if no date found

with logic that:

  • Extracts the match as before.
  • Validates with a strict regex ^\d{4}-\d{2}-\d{2}$.
  • Uses the fallback if validation fails.

No new imports or helper functions are required.

Suggested changeset 1
scripts/translate-propositions.cjs

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/scripts/translate-propositions.cjs b/scripts/translate-propositions.cjs
--- a/scripts/translate-propositions.cjs
+++ b/scripts/translate-propositions.cjs
@@ -620,7 +620,10 @@
   // Extract the date pattern from the source filename
   // e.g., "2026-02-18" from "2026-02-18-government-propositions-en.html"
   const dateMatch = path.basename(sourceFile).match(/(\d{4}-\d{2}-\d{2})/);
-  const datePattern = dateMatch ? dateMatch[1] : '2026-02-18'; // fallback if no date found
+  const extractedDate = dateMatch ? dateMatch[1] : null;
+  const datePattern = extractedDate && /^\d{4}-\d{2}-\d{2}$/.test(extractedDate)
+    ? extractedDate
+    : '2026-02-18'; // fallback if no valid date found
   
   // Update language switcher active state
   // Remove 'active' from the English link without changing its href
EOF
@@ -620,7 +620,10 @@
// Extract the date pattern from the source filename
// e.g., "2026-02-18" from "2026-02-18-government-propositions-en.html"
const dateMatch = path.basename(sourceFile).match(/(\d{4}-\d{2}-\d{2})/);
const datePattern = dateMatch ? dateMatch[1] : '2026-02-18'; // fallback if no date found
const extractedDate = dateMatch ? dateMatch[1] : null;
const datePattern = extractedDate && /^\d{4}-\d{2}-\d{2}$/.test(extractedDate)
? extractedDate
: '2026-02-18'; // fallback if no valid date found

// Update language switcher active state
// Remove 'active' from the English link without changing its href
Copilot is powered by AI and may make mistakes. Always verify output.
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 8 out of 8 changed files in this pull request and generated 1 comment.

Comment on lines 527 to 535
const newsArticleStart = translated.indexOf('"@type": "NewsArticle"');
if (newsArticleStart !== -1) {
const descStart = translated.indexOf('"description":', newsArticleStart);
if (descStart !== -1) {
const descValueStart = translated.indexOf('"', descStart + 14) + 1;
const descValueEnd = translated.indexOf('"', descValueStart);
if (descValueEnd !== -1 && descValueEnd < translated.indexOf('"@type":', newsArticleStart + 100)) {
translated = translated.substring(0, descValueStart) + trans.description + translated.substring(descValueEnd);
}
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The JSON-LD description replacement logic has a fragile assumption. Line 533 checks if descValueEnd < translated.indexOf('"@type":', newsArticleStart + 100), which assumes the next @type field appears within 100 characters after the NewsArticle start. This could fail if the NewsArticle JSON-LD structure has more properties or different ordering.

Consider a more robust approach:

  1. Find the closing brace of the NewsArticle object by counting braces
  2. Or use a proper JSON parser to extract and modify just the NewsArticle block
  3. Or at minimum, increase the offset to something more reliable (e.g., 500 characters) and add bounds checking

The current implementation might work for the existing HTML structure but could break if the JSON-LD format changes.

Suggested change
const newsArticleStart = translated.indexOf('"@type": "NewsArticle"');
if (newsArticleStart !== -1) {
const descStart = translated.indexOf('"description":', newsArticleStart);
if (descStart !== -1) {
const descValueStart = translated.indexOf('"', descStart + 14) + 1;
const descValueEnd = translated.indexOf('"', descValueStart);
if (descValueEnd !== -1 && descValueEnd < translated.indexOf('"@type":', newsArticleStart + 100)) {
translated = translated.substring(0, descValueStart) + trans.description + translated.substring(descValueEnd);
}
const newsArticleTypeIndex = translated.indexOf('"@type": "NewsArticle"');
if (newsArticleTypeIndex !== -1) {
// Find the start of the NewsArticle object by locating the nearest opening brace before "@type"
const newsArticleObjectStart = translated.lastIndexOf('{', newsArticleTypeIndex);
if (newsArticleObjectStart !== -1) {
// Find the end of the NewsArticle object by counting braces
let depth = 0;
let newsArticleObjectEnd = -1;
for (let i = newsArticleObjectStart; i < translated.length; i++) {
const ch = translated[i];
if (ch === '{') {
depth++;
} else if (ch === '}') {
depth--;
if (depth === 0) {
newsArticleObjectEnd = i;
break;
}
}
}
if (newsArticleObjectEnd !== -1) {
const descStart = translated.indexOf('"description":', newsArticleTypeIndex);
if (descStart !== -1 && descStart < newsArticleObjectEnd) {
const descriptionKey = '"description":';
const firstQuoteIndex = translated.indexOf('"', descStart + descriptionKey.length);
if (firstQuoteIndex !== -1 && firstQuoteIndex < newsArticleObjectEnd) {
const descValueStart = firstQuoteIndex + 1;
const descValueEnd = translated.indexOf('"', descValueStart);
if (descValueEnd !== -1 && descValueEnd <= newsArticleObjectEnd) {
translated =
translated.substring(0, descValueStart) +
trans.description +
translated.substring(descValueEnd);
}
}
}
}

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 307560a. Implemented robust brace-counting algorithm to find exact NewsArticle object boundaries instead of relying on 100-char offset assumption. The new logic:

  1. Finds NewsArticle object start using lastIndexOf('{', newsArticleTypeIndex)
  2. Counts opening/closing braces to locate object end
  3. Only replaces description within validated NewsArticle boundaries
  4. Works regardless of JSON-LD structure, property ordering, or whitespace

@github-actions
Copy link
Contributor

🔍 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 8 out of 8 changed files in this pull request and generated 2 comments.

@@ -0,0 +1,291 @@
# Government Propositions Enhancement Implementation Plan
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

Three new markdown documentation files were created (PROPOSITION_ENHANCEMENT_PLAN.md, ENHANCEMENT_SUMMARY.md, BEFORE_AFTER_COMPARISON.md) without explicit user request. According to the repository's coding guidelines (CodingGuidelineID: 1000000), "Never Create New Markdown Files (Unless Explicitly Requested)" - you should update existing documentation files or add sections to existing files instead. Consider consolidating this content into existing documentation or removing these files.

Copilot generated this review using guidance from repository custom instructions.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 307560a. Removed all 3 markdown documentation files (PROPOSITION_ENHANCEMENT_PLAN.md, ENHANCEMENT_SUMMARY.md, BEFORE_AFTER_COMPARISON.md) that were created without explicit request. Follows repository guideline: "Never Create New Markdown Files (Unless Explicitly Requested)".

"articleSection": "Analysis",
"articleBody": "&lt;h2&gt;Government Propositions&lt;/h2&gt; &lt;h3&gt;Reporting obligations for certain e-identification companies&lt;/h3&gt; &lt;p&gt;&lt;strong&gt;Document:&lt;/strong&gt; &lt;a href=&quot;https://data.riksdagen.se/dokument/HD03126.html&quot; class=&quot;document-link&quot; rel=&quot;noopener noreferrer&quot;&gt;HD03126&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Government proposal to Parliament.&lt;/p&gt; &lt;h3&gt;&lt;s...",
"wordCount": 711,
"articleBody": "Ten government propositions this week paint a picture of regulatory modernization focused on financial oversight and business compliance. From VAT fraud prevention to beneficial ownership transparency, digital infrastructure reliability to systemic financial risk management...",
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The JSON-LD NewsArticle schema still contains an articleBody field on line 107. According to the PR description, "Removed inaccurate/truncated articleBody field from NewsArticle JSON-LD" was a fix applied to all files. This field should be removed for consistency with the other enhanced proposition files (2026-02-14, 2026-02-16, 2026-02-18) which correctly omit it.

Suggested change
"articleBody": "Ten government propositions this week paint a picture of regulatory modernization focused on financial oversight and business compliance. From VAT fraud prevention to beneficial ownership transparency, digital infrastructure reliability to systemic financial risk management...",

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 307560a. Removed articleBody field from 2026-02-17 NewsArticle JSON-LD (line 107). Now consistent with other enhanced proposition files (2026-02-14, 2026-02-16, 2026-02-18) which correctly omit this field.

@pethers
Copy link
Member

pethers commented Feb 19, 2026

@copilot apply changes based on the comments in this thread

…ove articleBody, delete documentation files

- Make JSON-LD description replacement robust by counting braces to find NewsArticle object boundaries (comment 2825469316)
- Remove articleBody field from 2026-02-17 NewsArticle JSON-LD for consistency (comment 2825504156)
- Delete 3 markdown documentation files created without explicit request (comment 2825504144):
  - PROPOSITION_ENHANCEMENT_PLAN.md
  - ENHANCEMENT_SUMMARY.md
  - BEFORE_AFTER_COMPARISON.md

Follows repository guideline: "Never Create New Markdown Files (Unless Explicitly Requested)"

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions
Copy link
Contributor

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions
Copy link
Contributor

🔍 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

@pethers pethers marked this pull request as ready for review February 19, 2026 04:16
@pethers pethers merged commit fad64a4 into main Feb 19, 2026
16 of 17 checks passed
@pethers pethers deleted the copilot/enhance-government-propositions-articles branch February 19, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation updates html-css HTML/CSS changes javascript JavaScript code changes news News articles and content generation refactor Code refactoring size-xl Extra large change (> 1000 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance Government Propositions Articles with Full Policy Analysis and Legislative Context (All 2026 Dates)

2 participants

Comments