πŸ—³οΈ Election Cycle

July 23, 2026 Β· View on GitHub

Generates the deepest Riksdagsmonitor intelligence product β€” a full 4-year-mandate political assessment covering the current TidΓΆ cycle (2022-09-11 β†’ 2026-09-13) and/or the next cycle (2026-09-13 β†’ 2030-09-08). Tier-C aggregation Γ— 2.5 depth multiplier.

Non-English HTML pages are produced via the localized executive-brief cascade β€” the renderer composes the English article.md body with executive-brief_<lang>.md (when present) into each target language. The dedicated news-translate workflow runs on a separate track and translates executive-brief.md markdown into 13 language siblings (executive-brief_<lang>.md). Per-type workflows do not write article.<lang>.md.

What this workflow does

  • Article type: election-cycle (registry id; see analysis/article-types.json)
  • Analysis subfolder: analysis/daily/$ARTICLE_DATE/election-cycle/{current,next}/ β€” one sub-subfolder per cycle anchor when cycle_anchor=both.
  • Aggregated markdown: one per anchor (article.md lives in each sub-subfolder).
  • Rendered HTML: news/$ARTICLE_DATE-election-cycle-{current,next}-{en,sv,da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh}.html β€” always all 14 languages.
  • Horizon: 1 460 days (4 years); lookback 365 days.
  • Single-run model: same as week/month/quarter/year-ahead; one PR with all rendered HTML for both anchors when cycle_anchor=both. The renderer uses the localized executive-brief cascade (mergeLocalizedWithEnglish) to produce non-English HTML.

Cycle anchor semantics

  • current (TidΓΆ Mandate, 2022-09-11 β†’ 2026-09-13)
    • Mandate-fulfilment scorecard (every TidΓΆ-agreement bullet point: implemented / partial / abandoned)
    • KU reprimands ledger (every KU-anmΓ€lan against the government during the mandate)
    • Coalition cohesion trajectory (rolling 12-month vote-discipline metric per party)
  • next (Post-2026 Mandate, 2026-09-13 β†’ 2030-09-08)
    • Coalition-formation forecast (Sainte-LaguΓ« on latest seat projections Γ— all viable coalitions)
    • Post-election scenario tree (4 base Γ— 3 governing-coalition branches = 12 leaves)
    • Opposition trajectory (which parties become government / opposition under each leaf)

Cycle rollover

ext/cycle-rollover.md activates only within Β± 30 days of a Swedish election anchor (currently 2026-09-13). It encodes the file-rename + content-carry-forward + PIR archival procedure to convert in-flight cycle-current artifacts into cycle-next baselines. Outside the Β± 30-day window the module is a no-op.

Long-horizon mandate (from ext/long-horizon-forecasting.md)

  • Scenario count: 4 base Γ— 3 governing-coalition branches = 12 leaves in scenario-analysis.md. Probabilities at every level sum to 100 %.
  • Wildcards: β‰₯ 5 wildcards + β‰₯ 3 black-swan tails in wildcards-blackswans.md (blocking).
  • Counterfactuals: β‰₯ 3 explicit counterfactual paragraphs in devils-advocate.md.
  • PESTLE mandatory: blocking (pestle-analysis.md).
  • Quantitative-SWOT mandatory: blocking (quantitative-swot.md).
  • STRIDE assessment mandatory: blocking (political-stride-assessment.md) β€” every TTP carries an actor + dimension + risk score.
  • Cycle trajectory (24th artifact, this type only): cycle-trajectory.md β€” multi-year SCB + IMF + Riksdag throughput trend; ICD 203 BLUF + WEP per year; explicit horizon bands T+1y / T+2y / T+5y.
  • Cross-horizon citations: cite β‰₯ 2 most recent year-ahead analyses + β‰₯ 12 most recent monthly-review analyses in cross-reference-map.md.
  • IMF policy: full imf-fetch.ts compare across Nordic peers + multi-vintage trajectory (compare WEO Apr vs Oct vintages). Each citation includes projection-year stamp.
  • Forward indicators: β‰₯ 15 dated indicators across quarter / year / cycle / election bands.
  • Article floor: β‰₯ 3 500 words; β‰₯ 10 distinct dok_id references; β‰₯ 5 charts (election forecast, coalition matrix, mandate scorecard, fiscal trajectory, KU reprimand ledger).

Time budget

🟑 Plan to call safeoutputs___create_pull_request by agent minute 42 (hard deadline 45) to reserve job-level headroom for setup variance and the safe-outputs runner. See 00-base-contract.md §Session timing and 07-commit-and-pr.md §Deadline enforcement.

πŸ”΄ Token budget awareness: This workflow uses claude-opus-4.8 which consumes tokens rapidly on complex analysis. The 25M token budget can be exhausted in ~20 minutes of intensive MCP querying + large file writes. Check agent_minute before EVERY phase transition. If agent_minute β‰₯ 20 and zero analysis artifacts exist on disk, immediately compress scope to a minimal viable set and target PR by minute 35.

This workflow runs at the upper limit of the 60-minute job envelope. Initially gated workflow_dispatch-only until runtime is measured over 4–6 manual runs.

MinutesPhase
0–3MCP pre-warm + IMF multi-vintage pin
3–7Download data (Riksdag full-mandate corpus, SCB multi-year, IMF Nordic compare + multi-vintage)
7–29Analysis Pass 1 (24 artifacts at 2.5Γ— depth, 12-leaf scenario tree, full mandate scorecard or coalition forecast)
29–38Analysis Pass 2 (read-back; counterfactuals Γ— 3; horizon-band stratification across all five bands; extended Pass-2 slot reclaims the time freed by removing per-language Markdown translation β€” see TRANSLATION_GUIDE.md Β§News articles are translated out-of-band)
38–39Analysis Gate (long-horizon checks + 24th-artifact check + cycle-rollover check if within Β± 30 days)
39–40Aggregate (per-anchor article.md) + post-aggregate validate-article.ts (Check 12)
40–42Render (scripts/render-articles.ts --lang all β†’ all 14 HTML per anchor)
42–43Stage + commit + ONE safeoutputs___create_pull_request β€” HARD DEADLINE agent minute 45

🟑 Scope-compression rule: depth multiplier 2.5Γ— is aspirational β€” under the 60-min envelope, prefer reducing per-document Family-E coverage (drop dok_ids ranked < 6 in significance-scoring) rather than skipping any of the 24 artifacts. The 24-artifact contract is hard. When cycle_anchor=both, anchor coverage is also hard unless ext/cycle-rollover.md declares a formal rollover-window exception; time budget is never a valid reason to silently skip next/.

Inputs

  • article_date β€” override date (defaults to today)
  • force_generation β€” regenerate even if recent cycle analysis exists
  • cycle_anchor β€” current | next | both (default both)
  • analysis_depth β€” defaults to comprehensive

Note: there is no languages input. Every run produces all 14 language HTML files. Translation depth-of-quality scales with the time budget (see the table above).

File-write contract

πŸ›  Write every analysis artifact (analysis/daily/$DATE/$SUB/*.md, documents/*.md, JSON sidecars, methodology-reflection.md re-run deltas) with the edit tool. cat <<'QUOTED_EOF' > file is a Tier-2 fallback only β€” ASCII-only, no code fences / Mermaid / $ / backticks / EOF markers, < 200 lines, and only after edit has failed for a non-content reason. Banned for analysis/daily/** writes: python3, node -e, sed -i, echo … > file, tee file, unquoted heredocs (<<EOF) β€” sole exception: the pre-flight scaffold in 03-data-download.md (env-var refs and short literals only, no agent-generated content). The aggregator (scripts/aggregate-analysis.ts) and renderer (scripts/render-articles.ts) are the only writers for article.md and news/*.html. See 01-bash-and-shell-safety.md Β§File creation & overwrite strategy.

All other rules live in the imported modules.