πŸ›°οΈ 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; see analysis/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-ahead analyses + β‰₯ 4 most recent monthly-review analyses in cross-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.md is blocking β€” every SWOT row carries a numeric weighting and impact estimate.
  • IMF policy: full imf-fetch.ts compare across 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 / election bands.
  • Word floor: β‰₯ 2 500 words.
  • Election cycle anchor: current (until 2026-09-13); flips to next after the election (registry-driven).

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.

MinutesPhase
0–3MCP pre-warm + IMF vintage pin
3–7Download data (Riksdag + SCB + IMF Nordic-peer compare)
7–27Analysis Pass 1 (all 23 artifacts + PESTLE + wildcards + quantitative-SWOT at 2.0Γ— depth)
27–35Analysis Pass 2 (read-back; counterfactuals; horizon-band stratification)
35–37Analysis Gate (long-horizon checks)
37–38Aggregate (article.md)
38–40Render (scripts/render-articles.ts --lang all β†’ all 14 HTML)
40–42Stage + 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: warn will 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.md before calling safeoutputs___create_pull_request. Budget: 23 core artifacts + README (1) + article.md (1) + 14 HTML + pir-status.json (1) β‰ˆ 40 files. Never stage documents/ or pass1/ directories. If staged count exceeds 180, unstage documents/ 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 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.