Skip to content

Enforce English-only analysis artifacts; render non-EN via executive-brief cascade#2529

Merged
pethers merged 13 commits into
mainfrom
copilot/analyze-workflows-and-fix-issues
May 16, 2026
Merged

Enforce English-only analysis artifacts; render non-EN via executive-brief cascade#2529
pethers merged 13 commits into
mainfrom
copilot/analyze-workflows-and-fix-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 16, 2026

Address review thread 4304087566

  • (prior) Fix >= threshold + Swedish marker false positives
  • (prior) Frontmatter regex anchor + Check 12 + cascade ordering note
  • Exclude full-text/ from analysis-language scan (raw Swedish source material)
  • Strip blockquote-attributed quotations + Source title: / Källa: lines before Swedish-density count
  • Drop stale "regenerates article.<lang>.md × 13" from 05-analysis-gate.md re-run note
  • Reallocate freed translation slot in all 10 standard-workflow + quarter-ahead + election-cycle time tables (extended Pass 2 + post-aggregate Check 12)
  • Document Check 12 ordering dependency in 05-analysis-gate.md + add post-aggregation invocation in 06-article-generation.md §Step 1b
  • Clarify TRANSLATION_GUIDE.md wording: validator only rejects when localized article path is in changed-file input
  • Re-apply fetch-depth: 0 hand-edit to all 14 safe_outputs checkouts after recompile
  • Add tests for full-text/ exclusion + blockquote + source-title handling

Address review thread 4304114192

  • Align 03-data-download.md improvement-mode table with the English-only cascade (drop "re-translate any non-English article.<lang>.md"; re-aggregate English article.md and re-render 14 HTML via cascade; call out forbidden-artifact rule)
  • Clarify 06-article-generation.md §Step 2 that the renderer keeps the detailed article body in English and only swaps in the localized hero/SEO overlay (H1, dek, BLUF, JSON-LD headline/description, <title>, <meta> description, OG) from executive-brief_<lang>.md; <html lang> / JSON-LD inLanguage are still forced to the target language
  • Narrow check-analysis-language.ts source-title exemption to explicit attribution labels (Source title, Källa, Källtitel, Original title); bare Title: lines are no longer exempted, with a regression test locking the behavior in
  • Fix stale cross-reference in 05-analysis-gate.md re-run note: post-aggregation validator invocation lives in 06-article-generation.md §Step 1b — Editorial QA re-check (post-aggregation), not §Step 2

Copilot AI and others added 9 commits May 16, 2026 15:40
- Add §Output language in 00-base-contract: all 23+E analysis artifacts must be English
- Add §Output language in 04-analysis-pipeline: headings/prose in English, Swedish proper nouns preserved
- Replace Step 2 in 06-article-generation: per-type workflows no longer write article.<lang>.md
- Add Check 12 in 05-analysis-gate: npx tsx scripts/check-analysis-language.ts

Localized content is confined to executive-brief_<lang>.md (news-translate) and rendered HTML (cascade).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
- Create scripts/check-analysis-language.ts: enforce English-only analysis artifacts
- Scan for Swedish function words / political vocab with 5% density threshold
- Exempt executive-brief_<lang>.md, pass1/, data-download-manifest.md
- Add npm script check:analysis-language

Implements gate Check 12 from 05-analysis-gate.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
- Add isLocalizedArticleMd() predicate matching article.<lang>.md pattern
- Return false in isFileOwnedByCategory() for all categories (forbidden)
- Include article.<lang>.md in validateFileList() ownedFiles filter

Non-English HTML is now rendered via localized executive-brief cascade.
Per-type workflows must NOT write article.<lang>.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
- Remove 'Translate article.md → article.<lang>.md' row from time budget tables
- Update prose: 'aggregate → render' instead of 'aggregate → translate → render'
- Update file budget: 50 files max (was 63), drop '13 article.<lang>.md' slot
- Update description: 'via executive-brief cascade' instead of 'EN + SV + 12 translated'
- Clarify: non-English HTML rendered via localized executive-brief cascade

Applies to all 13 per-type workflows (news-propositions, news-motions, etc.).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…scade

- Per-type workflows write only English article.md
- Non-English HTML rendered via localized executive-brief cascade (mergeLocalizedWithEnglish)
- English body remains English; only executive-brief hero + SEO is localized
- article.<lang>.md is now forbidden by validate-file-ownership.ts
- news-translate owns executive-brief_<lang>.md exclusively

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Tests for scripts/check-analysis-language.ts:
- stripMarkdownCodeAndFrontmatter removes YAML, code fences, inline code
- tokenizeWords extracts lowercase words including Swedish å/ä/ö
- calculateSwedishDensity detects 100% English (density=0) vs heavily Swedish (>5%)
- findAnalysisMarkdownFiles exempts executive-brief_<lang>.md, pass1/, data-download-manifest.md
- validateAnalysisLanguage enforces 5% threshold with MIN_SWEDISH_MARKERS=5

Tests for validate-file-ownership.ts article.<lang>.md ban:
- article.sv.md is violation in both content AND translation categories
- article.md (English source) continues to pass as before
- Multiple localized article files all flagged as violations

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
- Fixed multi-line @description in JSDoc (tsc interpreted as code)
- Removed unused 'sep' import from node:path
- Added beforeEach/afterEach imports from vitest

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Recompiled all 14 agentic workflow lock files with gh aw compile v0.74.3.
No errors, 0 new warnings (existing warnings for IMF secrets and schedule timing unchanged).

Lock files updated to reflect:
- Removed translation phase from per-type workflows
- Updated time budgets and file count arithmetic
- Changed prose from 'aggregate → translate → render' to 'aggregate → render'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
…age scan

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions Bot added documentation Documentation updates dependencies Dependency updates workflow GitHub Actions workflows i18n Internationalization/localization translation Translation updates ci-cd CI/CD pipeline changes testing Test coverage refactor Code refactoring news News articles and content generation agentic-workflow Agentic workflow changes size-xl Extra large change (> 1000 lines) labels May 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🏷️ Automatic Labeling Summary

This PR has been automatically labeled based on the files changed and PR metadata.

Applied Labels: documentation,dependencies,workflow,i18n,translation,ci-cd,testing,refactor,size-xl,news,agentic-workflow

Label Categories

  • 🗳️ Content: news, dashboard, visualization, intelligence
  • 💻 Technology: html-css, javascript, workflow, security
  • 📊 Data: cia-data, riksdag-data, data-pipeline, schema
  • 🌍 I18n: i18n, translation, rtl
  • 🔒 ISMS: isms, iso-27001, nist-csf, cis-controls
  • 🏗️ Infrastructure: ci-cd, deployment, performance, monitoring
  • 🔄 Quality: testing, accessibility, documentation, refactor
  • 🤖 AI: agent, skill, agentic-workflow

For more information, see .github/labeler.yml.

@github-actions
Copy link
Copy Markdown
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 requested a review from pethers May 16, 2026 16:06
@pethers pethers marked this pull request as ready for review May 16, 2026 16:06
Copilot AI review requested due to automatic review settings May 16, 2026 16:06
Copy link
Copy Markdown
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 37 out of 37 changed files in this pull request and generated 6 comments.

Comment thread scripts/check-analysis-language.ts Outdated
Comment on lines +49 to +50
// Remove YAML frontmatter (---\n...\n---)
body = body.replace(/^---\n[\s\S]*?\n---\n/m, '');
Comment thread .github/prompts/05-analysis-gate.md Outdated
## Implementation

No dedicated validator script exists yet — implement the checks as an inline bash gate. Full implementation (covers checks 1–11, plus conditional check 9b where applicable):
No dedicated validator script exists yet — implement the checks as an inline bash gate. Full implementation (covers checks 1–13, plus conditional check 9b where applicable):
### Step 2 — (No-op) Per-language Markdown translation is no longer performed

Before rendering, the agent **SHOULD** produce a per-language Markdown sibling for every supported non-English language. The translation surface is the same canonical `article.md`; the renderer picks up `article.<lang>.md` automatically when it exists, and falls back to the English source otherwise — so any missing sibling temporarily degrades that language's HTML to English content under a non-English `<html lang>`. This fallback is acceptable as a **temporary** state within a single run's time budget. The `news-translate` workflow does **not** repair `article.<lang>.md` — its mission is the executive-brief markdown pipeline (`executive-brief.md` `executive-brief_<lang>.md`). If `article.<lang>.md` is missing, the next scheduled per-type run regenerates the whole article (including translations) from fresh analysis.
Per-type workflows do **not** produce `article.<lang>.md` for any non-English language. The agent stops after writing the canonical English `article.md` from Step 1. Non-English HTML pages are produced by `scripts/render-articles.ts` via the localized executive-brief cascade — the renderer composes the English `article.md` body with `executive-brief_<lang>.md` (when present) into a single Markdown document and emits chrome-wrapped HTML in the target language. See `scripts/render-lib/article-merge.ts` (`mergeLocalizedWithEnglish`) for the merge contract.
@@ -284,15 +284,15 @@ Generates deep political intelligence analysis **and** renders the HTML article
- **Aggregated markdown**: `analysis/daily/$ARTICLE_DATE/interpellations/article.md` (produced by `scripts/aggregate-analysis.ts`)
- **Per-language Markdown**: `analysis/daily/$ARTICLE_DATE/interpellations/article.<lang>.md` for `sv,da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh` (produced by the agent inside the same run)
Comment thread package.json
"sync-schemas": "npx tsx scripts/sync-cia-schemas.ts",
"validate-data": "npx tsx scripts/validate-against-cia-schemas.ts",
"check-updates": "npx tsx scripts/check-cia-schema-updates.ts",
"check:analysis-language": "tsx scripts/check-analysis-language.ts",
Comment on lines +127 to +132
// article.<lang>.md is now forbidden for ALL workflow categories.
// Per-type workflows must NOT write these files. The renderer uses
// the localized executive-brief cascade instead (mergeLocalizedWithEnglish).
if (isLocalizedArticleMd(filepath)) {
return false;
}
@pethers
Copy link
Copy Markdown
Member

pethers commented May 16, 2026

@copilot apply changes based on the comments in this thread

…r ignore, default arg, ordering note

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/91d7c03c-8cda-454b-9ea2-71d9271d9493

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

Copilot AI commented May 16, 2026

@copilot apply changes based on the comments in this thread

Applied all 6 review comments in 1b6c2ca6:

  1. Frontmatter regex (check-analysis-language.ts) — removed /m flag and added regression test; body --- thematic breaks no longer hide Swedish prose between them
  2. Check 12 in bash gate (05-analysis-gate.md) — added validate-article.ts invocation (conditional on article.md existing) before Check 13
  3. Cascade workflow ordering (06-article-generation.md) — added explicit ⚠️ note that newly translated executive-brief_<lang>.md only appears on the next per-type re-render of the same subfolder, since news-translate is forbidden from touching news/*.html
  4. news-interpellations.md:285 — removed the stale Per-language Markdown bullet that still listed article.<lang>.md as a workflow output
  5. package.json:74check:analysis-language now defaults to analysis/daily/ when no arg is passed (works as repo-wide audit; gate still passes $ANALYSIS_DIR explicitly)
  6. render-articles.ts — stops reading historical article.<lang>.md from disk entirely (passes '' to mergeLocalizedWithEnglish), so stale tracked translations cannot override the new cascade during builds

@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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 38 out of 38 changed files in this pull request and generated 16 comments.

Comment on lines +110 to +113
if (entry.isDirectory()) {
// Skip pass1/ subdirectories
if (entry.name === 'pass1') continue;
walk(fullPath);
Comment on lines +153 to +156
const { totalWords, swedishMarkerCount, density } = calculateSwedishDensity(filepath);

// Violation: density > threshold AND absolute count >= minimum
if (density > SWEDISH_DENSITY_THRESHOLD && swedishMarkerCount >= MIN_SWEDISH_MARKERS) {
## Implementation

No dedicated validator script exists yet — implement the checks as an inline bash gate. Full implementation (covers checks 1–11, plus conditional check 9b where applicable):
No dedicated validator script exists yet — implement the checks as an inline bash gate. Full implementation (covers checks 1–13, plus conditional check 9b where applicable). Check 12 invokes `scripts/validate-article.ts` when `article.md` is already present (after aggregation); Check 13 invokes `scripts/check-analysis-language.ts`:
| 28–30 | Analysis Gate (checks 1–8) | 05 |
| 30–32 | `scripts/aggregate-analysis.ts` → `article.md` | 06 |
| 32–40 | Translate `article.md` → `article.<lang>.md` for all 13 non-English languages (sv,da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh) | 06 |
| 40–42 | `scripts/render-articles.ts --lang all` → **all 14** HTML files | 06 |
Comment thread .github/workflows/news-weekly-review.md Outdated
@@ -302,11 +302,10 @@ Generates deep political intelligence analysis **and** renders the HTML article
| 18–28 | Analysis Pass 2 (read-back + improvements on all 22 text files) | 04 |
| 28–30 | Analysis Gate (checks 1–8) | 05 |
| 30–32 | `scripts/aggregate-analysis.ts` → `article.md` | 06 |
| 28–30 | Analysis Gate (checks 1–8) | 05 |
| 30–32 | `scripts/aggregate-analysis.ts` → `article.md` | 06 |
| 32–40 | Translate `article.md` → `article.<lang>.md` for all 13 non-English languages (sv,da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh) | 06 |
| 40–42 | `scripts/render-articles.ts --lang all` → **all 14** HTML files | 06 |
Comment thread .github/workflows/news-quarter-ahead.md Outdated
| 34–36 | Analysis Gate (checks 1–11 + Tier-C additive + long-horizon checks) | 05 |
| 36–38 | Aggregate (`article.md`) | 06 |
| 38–40 | Translate `article.md` → `article.<lang>.md` × 13 (sv,da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh) | 06 |
| 40–42 | Render (`scripts/render-articles.ts --lang all` → all 14 HTML) | 06 |
Comment on lines 344 to 345
| 41–42 | Render (`scripts/render-articles.ts --lang all` → all 14 HTML per anchor) |
| 42–43 | Stage + commit + ONE `safeoutputs___create_pull_request` — **HARD DEADLINE agent minute 45** |
Comment thread TRANSLATION_GUIDE.md Outdated
All 14 language renderings are produced by the per-type workflows themselves via the per-language `article.<lang>.md` step inside `06-article-generation.md`. The standalone [`news-translate`](.github/workflows/news-translate.md) workflow **does not touch** `news/*.html` at all; its sole mission is **executive-brief Markdown translation** — see §"Executive Brief Markdown Translations" below.
**All 14 language renderings are produced by the per-type workflows themselves** via the **localized executive-brief cascade** inside the renderer. Per-type workflows write **only** the canonical English `article.md` (aggregated from all 23 analysis artifacts). The renderer then composes the English `article.md` body with `executive-brief_<lang>.md` (when present) via the cascade chain in `scripts/render-lib/article-merge.ts` (`mergeLocalizedWithEnglish`) + `scripts/render-lib/aggregator/seo/localized-brief.ts` to produce each non-English HTML file. The English body remains in English prose — **only the executive-brief hero section + SEO metadata is localized**.

**Per-type workflows do NOT write `article.<lang>.md`** — these files are now **forbidden** by `scripts/validate-file-ownership.ts` (category-independent reject). Historical `article.<lang>.md` files left in the repo from old runs will be flagged as violations if they appear in a future validation input (e.g. a PR touching that folder).
Comment on lines +347 to +351
ART_MD_GATE="$ANALYSIS_DIR/article.md"
if [ -s "$ART_MD_GATE" ]; then
if command -v npx >/dev/null 2>&1; then
npx tsx scripts/validate-article.ts "$ART_MD_GATE" || FAIL=1
else
@pethers
Copy link
Copy Markdown
Member

pethers commented May 16, 2026

@copilot apply changes based on the comments in this thread

…ime-budget reallocation, post-aggregate check 12, ownership wording

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/af5b8bba-de99-4bdf-886c-3ea11bfb512b

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

Copilot AI commented May 16, 2026

@copilot apply changes based on the comments in this thread

Applied all 16 review comments in 79a68e66:

  1. full-text/ exclusion (check-analysis-language.ts) — skip raw downloaded Swedish source material; raw full-text/*.md no longer pollutes the gate
  2. Quoted/source-material handling — strip blockquote lines and Source title: / Källa: / Original title: lines before density measurement so attributed Swedish quotes don't trip the gate
  3. 05-analysis-gate.md re-run note — removed "regenerates article.<lang>.md × 13"; now references the executive-brief cascade and reaffirms the forbidden-artefact rule
    4–13. Workflow time-budget gaps (10 standard + quarter-ahead + election-cycle) — reallocated the freed translation slot into an explicitly-labelled extended Pass-2 read-back-and-improve phase (Pass 2 now 18–36 / 25–36 / 29–38 depending on workflow), with Check 12 invoked post-aggregate; no unexplained gaps remain
  4. TRANSLATION_GUIDE.md:39 — clarified that the ownership validator only rejects when the localized article path is in the changed-file input, not because an untouched historical file is on disk
  5. 05-analysis-gate.md Check 12 ordering — added a "Check 12 ordering note" subsection making explicit that the inline gate runs before aggregation (informational) and the workflow must re-invoke validate-article.ts after aggregate-analysis.ts; added matching §Step 1b in 06-article-generation.md with the post-aggregate command
  6. Re-applied the prior fetch-depth: 0 hand-edit to all 14 safe_outputs checkouts after recompile (preserves prior PR fix)

New tests added: full-text/ exclusion, blockquote-quoted Swedish passes, Source title: / Källa: lines pass — all 133 related tests green.

@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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 38 out of 38 changed files in this pull request and generated 4 comments.

Comment on lines +80 to +81
- The **only translated artifacts** are `analysis/daily/$DATE/$SUB/executive-brief_<lang>.md` for the 13 non-English target languages. They are produced exclusively by the dedicated `news-translate` workflow and consumed at render-time via the localized-brief cascade in `scripts/render-lib/article-merge.ts` (`mergeLocalizedWithEnglish`) + `scripts/render-lib/aggregator/seo/localized-brief.ts`. Per-type workflows MUST NOT write `executive-brief_<lang>.md` and MUST NOT write `article.<lang>.md` (the latter is now forbidden — see below).
- Non-English HTML pages (`news/$DATE-$SUB-<lang>.html`) are rendered by composing the English `article.md` body with the localized executive-brief overlay; no per-language article-body translation is performed any more.
Comment on lines +75 to +79
### Step 2 — (No-op) Per-language Markdown translation is no longer performed

Translation contract:
Per-type workflows do **not** produce `article.<lang>.md` for any non-English language. The agent stops after writing the canonical English `article.md` from Step 1. Non-English HTML pages are produced by `scripts/render-articles.ts` via the localized executive-brief cascade — the renderer composes the English `article.md` body with `executive-brief_<lang>.md` (when present) into a single Markdown document and emits chrome-wrapped HTML in the target language. See `scripts/render-lib/article-merge.ts` (`mergeLocalizedWithEnglish`) for the merge contract.

- Translate the body prose, headings and table cells.
- **Preserve verbatim**: YAML front-matter values that are identifiers (`subfolder`, `slug`, `source_folder`, `dok_id` references, file paths, GitHub URLs), Mermaid code fences, JSON code blocks, numeric values, and Schema.org / dataflow / dataset identifiers. Update `language:` in the front-matter to the target language code.
- Keep Swedish political terminology in Swedish where it is the proper noun (party names, committee names, document type acronyms, Riksdagsmonitor brand).
- For Arabic (`ar`) and Hebrew (`he`) the chrome handles `dir="rtl"` automatically — do not add inline direction overrides.
- Keep IMF / SCB / WB / Statskontoret citation blocks intact, including `economicProvenance` JSON.
> ⚠️ **Workflow ordering**: per-type workflows render HTML during the same run that produces the English `executive-brief.md`. The dedicated `news-translate` workflow runs on a separate schedule and back-fills `executive-brief_<lang>.md` *after the fact*. On the first HTML render the cascade therefore falls through to the English brief title/description for every non-EN language (`language: <lang>` is still forced so `<html lang>` / JSON-LD `inLanguage` are correct). The newly translated briefs only appear in the localized HTML on the **next** per-type re-render of the same subfolder (e.g. the next scheduled run, a `force_generation=true` re-run, or an explicit `npm run render-articles`). This is intentional — `news-translate` is **forbidden from touching `news/*.html`** (see `validate-file-ownership.ts`) to keep the file-ownership contract free of merge conflicts.
Comment on lines +75 to +80
// Remove verbatim-source-title lines (e.g. `Source title: Proposition om …`,
// `Källa: Riksdagens protokoll …`). Match the label at the start of a line
// (after optional list markers / bold wrappers) and drop the rest of the line.
body = body.replace(
/^[ \t]*(?:[-*+][ \t]+)?\**(?:Source title|Källa|Källtitel|Title|Original title)\**[ \t]*:[^\n]*$/gim,
''
Comment thread .github/prompts/05-analysis-gate.md Outdated

### Check 12 ordering note

Check 12 (`scripts/validate-article.ts`) is the **editorial QA gate** and runs on the aggregated `article.md`. The blocking branch in §Implementation only fires when `article.md` is already on disk; the inline gate runs before aggregation, so on a first pass the article validator is **informational** (the gate logs `ℹ️ Check 12 (editorial QA): … skipped (run after aggregator)`). Workflows MUST re-invoke the gate (or call `npx tsx scripts/validate-article.ts $ANALYSIS_DIR/article.md` directly) **after** `scripts/aggregate-analysis.ts` writes `article.md` so the editorial checks (banned phrases, citation density, `economicProvenance` vintage) become blocking before staging. See `06-article-generation.md §Step 2` for the post-aggregation invocation pattern.
@pethers
Copy link
Copy Markdown
Member

pethers commented May 16, 2026

@copilot apply changes based on the comments in this thread

…nment, body-stays-English clarity, narrow Title: exemption, §Step 1b xref

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/95dadcfb-32a5-4bb0-ab1b-69ffe37e7ec2

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

Copilot AI commented May 16, 2026

@copilot apply changes based on the comments in this thread

Applied all 4 review comments in 94c3ef95:

  1. 03-data-download.md improvement-mode table — dropped "re-translate any non-English article.<lang>.md" wording; re-runs now re-aggregate English article.md only and re-render 14 HTML via the cascade. Forbidden-artifact rule called out inline.
  2. 06-article-generation.md §Step 2 — clarified the renderer keeps the detailed article body in English and only swaps in the localized hero/SEO overlay from executive-brief_<lang>.md (H1, dek, BLUF, JSON-LD headline/description, <title>, <meta> description, OG). <html lang> / JSON-LD inLanguage are still forced.
  3. check-analysis-language.ts — narrowed the source-title exemption to explicit attribution labels (Source title, Källa, Källtitel, Original title); bare Title: is not exempted. New regression test verifies Swedish prose on Title: lines is now caught.
  4. 05-analysis-gate.md:385 — cross-reference fixed to 06-article-generation.md §Step 1b — Editorial QA re-check (post-aggregation).

All 22 check-analysis-language tests green.

@github-actions
Copy link
Copy Markdown
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 merged commit 7be28fd into main May 16, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentic-workflow Agentic workflow changes ci-cd CI/CD pipeline changes dependencies Dependency updates documentation Documentation updates i18n Internationalization/localization news News articles and content generation refactor Code refactoring size-xl Extra large change (> 1000 lines) testing Test coverage translation Translation updates workflow GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants