π°οΈ Year Ahead
July 23, 2026 Β· View on GitHub
Generates the deepest scheduled forward-look at Swedish politics β a 365-day annual outlook anchored in the freshest IMF WEO vintage available at run time (April or October), tracking the Swedish budget rhythm (BP autumn + VP spring), the RiksmΓΆte calendar, and EU presidency rotations affecting Swedish politics. Tier-C aggregation Γ 2.0 depth multiplier.
The dedicated news-translate workflow runs on a separate track and translates executive-brief.md markdown into 13 language siblings (executive-brief_<lang>.md)
What this workflow does
- Article type:
year-ahead(registry id; seeanalysis/article-types.json) - Analysis subfolder:
analysis/daily/$ARTICLE_DATE/year-ahead/ - Aggregated markdown:
analysis/daily/$ARTICLE_DATE/year-ahead/article.md - Rendered HTML:
news/$ARTICLE_DATE-year-ahead-{en,sv,da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh}.htmlβ always all 14 languages - Horizon: 365 days; lookback 180 days.
- Single-run model: download β analysis Pass 1 + 2 β gate β aggregate β render (14 languages) β ONE PR.
Long-horizon mandate (from ext/long-horizon-forecasting.md)
- Scenario count: β₯ 4 base scenarios + 5 wildcards in
scenario-analysis.md+wildcards-blackswans.md(the supplementary wildcards-blackswans template is blocking for this article type). - Counterfactuals: β₯ 2 explicit counterfactual paragraphs in
devils-advocate.md. - Cross-horizon citations: cite β₯ 2 most recent
quarter-aheadanalyses + β₯ 4 most recentmonthly-reviewanalyses incross-reference-map.md. Missing citations fail the gate. - PESTLE mandatory:
pestle-analysis.md(otherwise supplementary) is blocking β outside-in environmental scan across all six dimensions. - Quantitative-SWOT mandatory:
quantitative-swot.mdis blocking β every SWOT row carries a numeric weighting and impact estimate. - IMF policy: full
imf-fetch.ts compareacross Nordic peers (SWE, DNK, NOR, FIN) for WEO macro + FM fiscal + DOTS bilateral trade. Each WEO/FM citation must include the projection-year stamp (T+1, T+2, T+5). - Forward indicators: β₯ 12 dated indicators across
month / quarter / year / cycle / electionbands. - Word floor: β₯ 2 500 words.
- Election cycle anchor:
current(until 2026-09-13); flips tonextafter the election (registry-driven).
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.
| Minutes | Phase |
|---|---|
| 0β3 | MCP pre-warm + IMF vintage pin |
| 3β7 | Download data (Riksdag + SCB + IMF Nordic-peer compare) |
| 7β27 | Analysis Pass 1 (all 23 artifacts + PESTLE + wildcards + quantitative-SWOT at 2.0Γ depth) |
| 27β35 | Analysis Pass 2 (read-back; counterfactuals; horizon-band stratification) |
| 35β37 | Analysis Gate (long-horizon checks) |
| 37β38 | Aggregate (article.md) |
| 38β40 | Render (scripts/render-articles.ts --lang all β all 14 HTML) |
| 40β42 | Stage + commit + ONE safeoutputs___create_pull_request β HARD DEADLINE agent minute 45 |
π‘ Scope-compression rule: if you reach agent minute 35 without Pass 2 complete, halt Pass 2 deepening and run the gate against whatever you have β
if-no-changes: warnwill not silently fail the run, but a missing PR will. Always trim depth before iterating.
β οΈ HARD FILE LIMIT (200 files): The safe-outputs handler hard-rejects PRs with > 200 files (E003). You MUST run the 200-file guard from
07-commit-and-pr.mdbefore callingsafeoutputs___create_pull_request. Budget: 23 core artifacts + README (1) + article.md (1) + 14 HTML + pir-status.json (1) β 40 files. Never stagedocuments/orpass1/directories. If staged count exceeds 180, unstagedocuments/then JSON files until under budget. This is non-negotiable β the previous run failed with 269 files.
Inputs
article_dateβ override date (defaults to today)force_generationβ regenerate even if recent year-ahead exists (within 60 days)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.