diff --git a/.gitignore b/.gitignore index 846c1104d7..e56b0e1bd8 100644 --- a/.gitignore +++ b/.gitignore @@ -84,9 +84,18 @@ builds/ # Pass-1 snapshots used by the analysis gate (see .github/prompts/05-analysis-gate.md) analysis/daily/*/*/pass1/ +# SEO metadata backfill diff reports (see analysis/metadata-backfill/README.md and +# .github/prompts/seo-metadata-contract.md §6). Intentionally NOT ignored — +# the dry-run CSV is committed so PRs 3 / 4 / 5 can consume it deterministically +# and reviewers can inspect tier classification + violation codes in-place. # SEO metadata backfill diff reports (see analysis/metadata-backfill/README.md and # .github/prompts/seo-metadata-contract.md §6). Intentionally NOT ignored — # the dry-run CSV is committed so PRs 3 / 4 / 5 can consume it deterministically # and reviewers can inspect tier classification + violation codes in-place. !analysis/metadata-backfill/*.csv !analysis/metadata-backfill/README.md + +# Vendored Mermaid distribution copied from node_modules by +# scripts/copy-vendor-mermaid.ts during `prebuild`. Reproducible from the +# pinned `mermaid` devDependency in package.json — do not commit. +js/lib/mermaid/ diff --git a/Article-Generation.md b/Article-Generation.md index f45357adce..c0a42bcb9b 100644 --- a/Article-Generation.md +++ b/Article-Generation.md @@ -454,18 +454,38 @@ npx tsx scripts/aggregate-analysis.ts --all ### Cleaning and transformation rules -The aggregator: +The aggregator (see [`scripts/render-lib/aggregator.ts`](scripts/render-lib/aggregator.ts) `cleanArtifactBody`): - Requires `executive-brief.md`. - Inserts a `Reader Intelligence Guide` before artifact sections so public readers can find high-value analysis such as media framing and forward indicators without scanning every audit artifact. - Strips YAML front matter from each artifact. - Removes the first H1 from each artifact and injects its own consistent `## Section Title` heading. +- **Demotes every internal heading by one level** (`##` → `###`, `###` → `####`, …, capped at H6) before concatenation. Without this, every artifact's own H2s become siblings of the wrapper-injected `## Section Title` and the rendered article ends up with ~170 H2s and a flat outline that violates WCAG 2.4.6 ("Headings and Labels"). Headings inside fenced code blocks are not affected. **Tested by** [`tests/render-lib.test.ts > demoteHeadings`](tests/render-lib.test.ts). +- **Strips legacy `_Source: file.md_` italic preamble lines** that some artifact templates author at the top of their body. Source attribution now lives in the auto-generated [Reader Intelligence Guide](#-reader-intelligence-guide-deterministic-navigation-layer) and the [`## Article Sources` appendix](#-article-sources-appendix-canonical-source-list) — repeating it under every heading reads like a folder listing, not journalism. Inline prose mentions like *"primary source: data.riksdagen.se/…"* are preserved. +- **Normalises heading slugs** to drop leading hyphens emitted by `github-slugger` when a heading starts with a stripped character (e.g. emoji like `🎯` in `## 🎯 BLUF` slug to `-bluf` and would otherwise become `id="rm--bluf"` once the `rm-` prefix is applied). Both [`markdown.ts#rehypeSlugWithPrefix`](scripts/render-lib/markdown.ts) and [`aggregator.ts#anchorForTitle`](scripts/render-lib/aggregator.ts) collapse leading/trailing hyphens to keep heading IDs and Reader Intelligence Guide anchors in lock-step. - Removes leading admin bylines such as `Author`, `Run ID`, `Classification`, `Confidence`, `Prepared by`, `Methodology` and similar metadata fields. - Removes trailing `Document control`, `Audit trail`, `Generated by`, template footer and `Pass 2` self-audit sections. - Rewrites relative Markdown links to absolute GitHub blob URLs. - Keeps Mermaid fences untouched so the renderer can preserve them. +- Annotates each section heading with an HTML comment of shape `` for offline auditors. The comment is dropped by `rehype-sanitize` so it never reaches rendered HTML. - Builds front matter with `title`, `description`, `date`, `subfolder`, `slug`, `source_folder`, `generated_at`, `language` and `layout`. +### 📚 Article Sources appendix (canonical source list) + +After every artifact section the aggregator emits a single `## Article Sources` H2 at the very end of the article. Each entry is a markdown list link to the artifact on GitHub: + +```markdown +## Article Sources + +Each section above projects one analysis artifact. The full audited markdown is available on GitHub: + +- [`executive-brief.md`](https://github.com/Hack23/riksdagsmonitor/blob/main/analysis/daily/.../executive-brief.md) +- [`synthesis-summary.md`](https://github.com/.../synthesis-summary.md) +- … +``` + +This replaces the legacy per-section `_Source: file.md_` italics. Auditors get one canonical list; readers see clean prose; SEO crawlers see one trustworthy `
-

🏛️ 3. Opposition Bloc (S / V / MP)

+

🏛️ 3. Opposition Bloc (S / V / MP)

Socialdemokraterna (S):


-

🏢 4. Business & Industry

+

🏢 4. Business & Industry

Real estate sector (Mäklarsamfundet, FMI): Broadly supportive of CU28 condominium register (reduces market uncertainty and mispricing risk). [HIGH]

Banks & mortgage lenders (SEB, Swedbank, Handelsbanken, SBAB): Supportive — cleaner pledge/mortgage registration reduces collateral risk; AML compliance cost offset by data-quality gain. [HIGH]

Defence industry (Saab, BAE Bofors): Neutral on accountability measures; benefits from general Ukraine support sustaining procurement trajectory. [MEDIUM]

Tech / publishing sector: Interest in accessibility compliance (KU32 e-books, streaming, e-commerce); mixed — cost of implementation vs market-expansion opportunity. [MEDIUM]

Media (Bonnier, Schibsted, Stampen): Concerned about KU33 — see risk of source-erosion affecting investigative desks. [MEDIUM]


-

🌐 5. Civil Society

+

🌐 5. Civil Society

Press-freedom organisations (TU, Utgivarna, SJF, Publicistklubben):

+

🌍 6. International Actors

@@ -1975,7 +1975,7 @@

🌍 6. International Actors
ActorUkraine Props PositionKU33 PositionNotes
Ukraine (Zelensky gov)🟢 Central proponent🟡 NeutralHague Convention signed Dec 16 2025 with Zelensky present
Council of Europe🟢 Framework body🟡 NeutralTribunal legitimacy backstop; Venice Commission may later comment on KU33
EU institutions🟢 Strongly supportive🟡 Neutral (supportive of KU32 via EAA)Foreign-policy alignment; EAA compliance box ticked
NATO allies🟢 PositiveSweden's norm-entrepreneurship as new member
Russia (RF)🔴 HostileWill respond rhetorically + hybrid ops
US administration🟡 AmbiguousHistorical ICC reluctance; tribunal-specific position pending
RSF / Freedom House🟡 Neutral🔴 Will scrutiniseSweden's press-freedom index score at risk

-

⚖️ 7. Judiciary & Constitutional Bodies

+

⚖️ 7. Judiciary & Constitutional Bodies


-

📰 8. Media & Public Opinion

+

📰 8. Media & Public Opinion

Swedish mainstream media (DN, SvD, Aftonbladet, Expressen, SVT):


-

🎙️ Named-Actor Briefing Cards

-

Card 1 — Magdalena Andersson (S, former PM, current party leader)

+

🎙️ Named-Actor Briefing Cards

+

Card 1 — Magdalena Andersson (S, former PM, current party leader)

-

Card 2 — Gunnar Strömmer (M, Justice Minister)

+

Card 2 — Gunnar Strömmer (M, Justice Minister)

-

Card 3 — Lagrådet (Collective)

+

Card 3 — Lagrådet (Collective)

-

Card 4 — Nooshi Dadgostar (V leader)

+

Card 4 — Nooshi Dadgostar (V leader)

-

Card 5 — Maria Malmer Stenergard (M, FM)

+

Card 5 — Maria Malmer Stenergard (M, FM)

-

Card 6 — Jimmie Åkesson (SD leader)

+

Card 6 — Jimmie Åkesson (SD leader)