Conversation
…md template-to-artifact map is complete Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/caca85e2-f64c-4c39-a40c-24f1a75c8546 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🏷️ Automatic Labeling SummaryThis PR has been automatically labeled based on the files changed and PR metadata. Applied Labels: documentation,size-m Label Categories
For more information, see |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
There was a problem hiding this comment.
Pull request overview
This PR standardizes and expands Mermaid usage across long-horizon analysis templates and updates documentation so template/artifact ordering matches the aggregator’s canonical narrative sequence.
Changes:
- Added new Mermaid diagrams to three long-horizon templates (
cycle-trajectory.md,horizon-pir-rollforward.md,parliamentary-season.md). - Documented a “Mermaid colour-coding standard” in
analysis/templates/README.md, including a canonical init prologue and palette guidance. - Rewrote
Article-Generation.md’s template-to-artifact mapping table into an ordered, aggregator-aligned slot list, including operational supplementary templates.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| analysis/templates/parliamentary-season.md | Adds “Riksmöte phase ribbon” and “Watchlist heat-map” Mermaid diagrams. |
| analysis/templates/horizon-pir-rollforward.md | Adds a PIR genealogy Mermaid graph and colour-coding explanation. |
| analysis/templates/cycle-trajectory.md | Adds a T+1y→T+5y trajectory-band Mermaid visual and colour semantics. |
| analysis/templates/README.md | Documents the Mermaid colour-coding standard, palette, and render chain. |
| Article-Generation.md | Replaces the old partial template map with an ordered, “exhaustive” aggregator-slot table plus supplementary templates. |
| The analysis gate ([`05-analysis-gate.md` Check 5](../../.github/prompts/05-analysis-gate.md)) blocks any Family A or Family D synthesis file whose Mermaid blocks lack a `style` directive **or** a `themeVariables` / `%%{init …}` block. To keep colour semantics consistent across the 35 templates that already render Mermaid (and the 3 long-horizon templates that just received their first diagram — `cycle-trajectory.md`, `horizon-pir-rollforward.md`, `parliamentary-season.md`) every diagram MUST follow the palette below — derived from the cyberpunk article-chrome tokens documented in [`Article-Generation.md` §"Light and dark mode"](../../Article-Generation.md#light-and-dark-mode). | ||
|
|
||
| | Hex | Token / role | Colour use | | ||
| |---|---|---| | ||
| | `#1565C0` | `--primary-blue` | Structural / process / data-source nodes (BLUF anchor, ingest, predecessor run) | | ||
| | `#2E7D32` | `--success-green` | Strengths · opportunities · "active" · low-risk indicators | | ||
| | `#FF9800` | `--warning-orange` | Watch items · medium severity · mid-mandate years | | ||
| | `#D32F2F` | `--danger-red` | Threats · weaknesses · falsification triggers · high severity | | ||
| | `#7B1FA2` | `--strategic-purple` | Synthesis · scenarios · long-horizon projections | | ||
| | `#00897B` | `--data-teal` | Data products · cycle-spanning PIRs · IMF / SCB feeds | | ||
| | `#FFBE0B` | `--primary-yellow` | Edges, accents, stroke highlights, "this run" anchor | | ||
| | `#FF006E` | `--primary-magenta` | New PIRs, emphasis, election-anchor pivots | | ||
| | `#616161` | `--neutral-grey` | Archived / deprecated / pending nodes | |
| | 10 | Strategic | [`swot-analysis.md`](analysis/templates/swot-analysis.md) | Evidence-bound SWOT quadrant + TOWS moves (Mermaid quadrantChart). | | ||
| | 11 | Threat | [`threat-analysis.md`](analysis/templates/threat-analysis.md) | Political Threat Taxonomy + attack-tree Mermaid diagrams. | | ||
| | — | Per-document | [`per-file-political-intelligence.md`](analysis/templates/per-file-political-intelligence.md) → `documents/{dok_id}-analysis.md` | One subsection per primary-source document; required to cite the dok_id. | | ||
| | 12 | Election | [`election-2026-analysis.md`](analysis/templates/election-2026-analysis.md) / [`election-cycle-analysis.md`](analysis/templates/election-cycle-analysis.md) | Seat deltas, campaign implications; alias-deduplicated by `FILENAME_ALIASES`. | |
| Q3["Coalition cohesion<br/>< 95 %"]:::high | ||
| end | ||
| subgraph YEAR["📅 Year horizon (≤ 365 d)"] | ||
| Y1["Lagrådet kritik rate<br/>> 35 %"]:::med | ||
| Y2["IMF WEO vintage drift<br/>> 0.3 pp"]:::low | ||
| end | ||
| subgraph CYCLE["🗳️ Cycle horizon (≤ 1460 d)"] | ||
| C1["Mandate fulfilment<br/>< 60 %"]:::high |
| Y2["IMF WEO vintage drift<br/>> 0.3 pp"]:::low | ||
| end | ||
| subgraph CYCLE["🗳️ Cycle horizon (≤ 1460 d)"] | ||
| C1["Mandate fulfilment<br/>< 60 %"]:::high |
| ```mermaid | ||
| %%{init: {"theme":"dark","themeVariables":{"primaryColor":"#1565C0","primaryTextColor":"#ffffff","lineColor":"#90CAF9","fontFamily":"Inter, Helvetica, Arial, sans-serif"}}}%% | ||
| flowchart TB |
| | `sequenceDiagram` | Coalition negotiations, KU referral cycles | `political-stride-assessment.md` | | ||
| | `mindmap` | PESTLE / stakeholder fan-outs | `pestle-analysis.md`, `stakeholder-impact.md` | | ||
|
|
||
| Mermaid renders **client-side** in the article HTML — the aggregator passes ` ```mermaid ` fences through untouched and `scripts/render-lib/markdown.ts` rewrites them to `<pre class="mermaid">` before the unified pipeline runs. `js/lib/mermaid-init.mjs` then upgrades each block to SVG after page load against the same-origin vendored runtime under `js/lib/mermaid/`. The full HTML rendering chain is documented in [`Article-Generation.md` §"Mermaid support"](../../Article-Generation.md#mermaid-support). |
|
@copilot apply changes based on the comments in this thread |
…iance, correct render-chain refs, add election-2026-implications alias Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/93aa8d9b-bbf5-4a79-90c2-02c1fe01ef70 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
All 6 review comments addressed in
|
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
| ### Watchlist heat-map | ||
|
|
||
| ```mermaid | ||
| %%{init: {"theme":"dark","themeVariables":{"primaryColor":"#1565C0","primaryTextColor":"#ffffff","lineColor":"#FFBE0B","fontFamily":"Inter, Helvetica, Arial, sans-serif"}}}%% |
| Colour coding: 🟦 predecessor run · 🟣 this run · 🟢 active inherited PIR · 🟦-dashed cycle-spanning PIR (`inheritsCycle: true`) · 🟡 newly-created PIR · ⚫ archived PIR. Solid edges encode PIR provenance; dotted edges encode supersession (`PIR-X → PIR-X+1`). The graph must contain at least one node per row of the genealogy table above. | ||
|
|
|
|
||
| ### 🎨 Mermaid colour-coding standard (canonical) | ||
|
|
||
| The analysis gate ([`05-analysis-gate.md` Check 5](../../.github/prompts/05-analysis-gate.md)) blocks any Family A or Family D synthesis file whose Mermaid blocks lack a `style` directive **or** a `themeVariables` / `%%{init …}` block. To keep colour semantics consistent across the 35 templates that already render Mermaid (and the 3 long-horizon templates that just received their first diagram — `cycle-trajectory.md`, `horizon-pir-rollforward.md`, `parliamentary-season.md`) every diagram MUST follow the palette below — derived from the cyberpunk article-chrome tokens documented in [`Article-Generation.md` §"Light and dark mode"](../../Article-Generation.md#light-and-dark-mode). |
| | op | Run navigator | [`analysis-index.md`](analysis/templates/analysis-index.md) | Read-me-first run index; not aggregated into the article body but linked from the Reader Intelligence Guide. | | ||
| | op | Same-type baseline | [`session-baseline.md`](analysis/templates/session-baseline.md) | 30-day baseline for pattern recognition (operational supplementary). | | ||
| | op | Day-over-day | [`cross-run-diff.md`](analysis/templates/cross-run-diff.md) | Same-type delta (gate-required when `ANALYSIS_RUN_COUNT ≥ 2`). | | ||
| | op | Cross-session | [`cross-session-intelligence.md`](analysis/templates/cross-session-intelligence.md) | Week / month / quarter aggregation across Riksdag sessions. | | ||
| | op | MCP health | [`mcp-reliability-audit.md`](analysis/templates/mcp-reliability-audit.md) | MCP tool reliability snapshot (operational supplementary). | | ||
| | op | Threshold audit | [`reference-analysis-quality.md`](analysis/templates/reference-analysis-quality.md) | Threshold audit against `reference-quality-thresholds.json`. | | ||
| | op | Workflow audit | [`workflow-audit.md`](analysis/templates/workflow-audit.md) | End-to-end run audit: timing, cost, gate outcomes. | | ||
|
|
||
| Templates **not** mapped to a slot — `analysis/templates/README.md` is the templates-directory index; `election-cycle-analysis.md` is a filename alias of `election-2026-analysis.md` (de-duplicated at render time by `FILENAME_ALIASES`). Anything else not in `AGGREGATION_ORDER` is appended after the core sections in alphabetical order. |
|
@copilot apply changes based on the comments in this thread |
…our, tighten gate Check 5 wording, correct op-template aggregation docs Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/2fbf9a53-9fbc-41fd-a277-0907b35536c5 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
All 4 review comments addressed in
|
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
| H["🍂 Höstsession<br/>Sep → mid-Dec<br/>BP tabling · budget vote"]:::active | ||
| JR["🎄 Juluppehåll<br/>mid-Dec → mid-Jan<br/>KU filings only"]:::recess | ||
| V["🌱 Vårsession<br/>mid-Jan → mid-Jun<br/>VP · partiledardebatt"]:::active | ||
| SR["☀️ Sommaruppehåll<br/>mid-Jun → late-Aug<br/>Almedalen · KU report"]:::recess | ||
| H --> JR --> V --> SR --> H |
| %%{init: {"theme":"dark","themeVariables":{"primaryColor":"#1565C0","primaryTextColor":"#ffffff","lineColor":"#FFBE0B","secondaryColor":"#7B1FA2","tertiaryColor":"#2E7D32","fontFamily":"Inter, Helvetica, Arial, sans-serif"}}}%% | ||
| ``` | ||
|
|
||
| For multi-state diagrams (flowchart / state / sequence), prefer `classDef` blocks over per-node `style` directives so colour semantics stay consistent across the diagram and the validator's `style …` regex still matches: |
| | op | Threshold audit | [`reference-analysis-quality.md`](analysis/templates/reference-analysis-quality.md) | Threshold audit against `reference-quality-thresholds.json` (aggregated alphabetically after core slots). | | ||
| | op | Workflow audit | [`workflow-audit.md`](analysis/templates/workflow-audit.md) | End-to-end run audit: timing, cost, gate outcomes (aggregated alphabetically after core slots). | | ||
|
|
||
| > **Aggregation behavior for "op" templates:** The aggregator (step 4 in `aggregate.ts`) appends *any* remaining `*.md` file — excluding `README.md` and `article*.md` — in alphabetical order after the 29 core `AGGREGATION_ORDER` slots. This means operational templates listed above **will appear** in the rendered article if they exist in the analysis folder. They sit after the core narrative but before the Sources appendix. `analysis/templates/README.md` is the templates-directory index and is excluded by the `README.md` filter; `election-cycle-analysis.md` is a filename alias of `election-2026-analysis.md` (de-duplicated at render time by `FILENAME_ALIASES`). |
| | 3 | Key Judgments | [`intelligence-assessment.md`](analysis/templates/intelligence-assessment.md) | Provides ≥ 3 Key Judgments + PIRs + confidence labels (ICD 203). | | ||
| | 4 | Ranking | [`significance-scoring.md`](analysis/templates/significance-scoring.md) | DIW scoring + sensitivity analysis with evidence-tagged rows and ranked Mermaid bar chart. | | ||
| | 5 | Narrative contestation | [`media-framing-analysis.md`](analysis/templates/media-framing-analysis.md) | DISARM TTPs · CIB ABCDE · narrative-laundering chain · Outlet Bias Audit · L1–L5 counter-resilience ladder. | | ||
| | 6 | Stakeholders | [`stakeholder-impact.md`](analysis/templates/stakeholder-impact.md) → `stakeholder-perspectives.md` | Power × interest × position lens, named actors and influence network. | |
|
@copilot apply changes based on the comments in this thread |
…ng, AGGREGATION_ORDER count, stakeholder filename note Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/5755fbd0-3b6a-4df6-9ee9-e9224442f602 Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
All 4 review comments addressed in
|
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
Plan
cycle-trajectory.md,horizon-pir-rollforward.md,parliamentary-season.mdanalysis/templates/README.mdArticle-Generation.mdtemplate-to-artifact map to matchAGGREGATION_ORDER--primary-blueetc. CSS token names with hex + semantic role descriptions (README.md)election-2026-implications.mdto the Election alias row (Article-Generation.md)< 95 %and< 60 %asbelow 95 %/below 60 %in Mermaid node labels to avoid HTML parsing breakage (parliamentary-season.md)#90CAF9with#FFBE0Bin the watchlist diagram lineColor and classDef stroke (parliamentary-season.md)scripts/render-lib/markdown.tsto currentscripts/render-lib/markdown/mermaid-preprocess.ts+pipeline.ts(README.md)secondaryColor/tertiaryColorto parliamentary-season.md init prologue to match canonical standard#00897B, not blueGATE_SYNTH_LISTenforcement scope:::currentat runtimethemeVariables/%%{init}, notstyleregex