π³οΈ 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; seeanalysis/article-types.json) - Analysis subfolder:
analysis/daily/$ARTICLE_DATE/election-cycle/{current,next}/β one sub-subfolder per cycle anchor whencycle_anchor=both. - Aggregated markdown: one per anchor (
article.mdlives 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-aheadanalyses + β₯ 12 most recentmonthly-reviewanalyses incross-reference-map.md. - IMF policy: full
imf-fetch.ts compareacross 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 / electionbands. - Article floor: β₯ 3 500 words; β₯ 10 distinct
dok_idreferences; β₯ 5 charts (election forecast, coalition matrix, mandate scorecard, fiscal trajectory, KU reprimand ledger).
Time budget
π‘ Plan to call
safeoutputs___create_pull_requestby agent minute 42 (hard deadline 45) to reserve job-level headroom for setup variance and the safe-outputs runner. See00-base-contract.md Β§Session timingand07-commit-and-pr.md Β§Deadline enforcement.π΄ Token budget awareness: This workflow uses
claude-opus-4.8which consumes tokens rapidly on complex analysis. The 25M token budget can be exhausted in ~20 minutes of intensive MCP querying + large file writes. Checkagent_minutebefore 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.
| Minutes | Phase |
|---|---|
| 0β3 | MCP pre-warm + IMF multi-vintage pin |
| 3β7 | Download data (Riksdag full-mandate corpus, SCB multi-year, IMF Nordic compare + multi-vintage) |
| 7β29 | Analysis Pass 1 (24 artifacts at 2.5Γ depth, 12-leaf scenario tree, full mandate scorecard or coalition forecast) |
| 29β38 | Analysis 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β39 | Analysis Gate (long-horizon checks + 24th-artifact check + cycle-rollover check if within Β± 30 days) |
| 39β40 | Aggregate (per-anchor article.md) + post-aggregate validate-article.ts (Check 12) |
| 40β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 |
π‘ 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 unlessext/cycle-rollover.mddeclares a formal rollover-window exception; time budget is never a valid reason to silently skipnext/.
Inputs
article_dateβ override date (defaults to today)force_generationβ regenerate even if recent cycle analysis existscycle_anchorβcurrent|next|both(defaultboth)analysis_depthβ defaults tocomprehensive
Note: there is no
languagesinput. 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.mdre-run deltas) with theedittool.cat <<'QUOTED_EOF' > fileis a Tier-2 fallback only β ASCII-only, no code fences / Mermaid /$/ backticks /EOFmarkers, < 200 lines, and only afteredithas failed for a non-content reason. Banned foranalysis/daily/**writes:python3,node -e,sed -i,echo β¦ > file,tee file, unquoted heredocs (<<EOF) β sole exception: the pre-flight scaffold in03-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 forarticle.mdandnews/*.html. See01-bash-and-shell-safety.mdΒ§File creation & overwrite strategy.
All other rules live in the imported modules.