Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | 1x 5x 4x 4x 48x 90x 4x 4x 77x 1x 3x 3x | /**
* @module IMF/Context
* @description Policy-area → IMF indicator mapping, mirroring the surface of
* `world-bank-context.ts`.
*
* Where World Bank data lags 12–24 months, IMF data (WEO April/October
* cycle; Fiscal Monitor; IFS; GFS_COFOG) leads. The agentic workflows
* use this module at article-authoring time to pick the correct IMF
* indicator for each Riksdag committee's policy area and to stamp
* projections with the right vintage.
*
* Scope: narrow, code-only mapping for the indicators currently used by
* the four "look-ahead" article types (week-ahead, month-ahead,
* weekly-review, monthly-review) plus the macro-adjacent daily types
* (committee-reports, propositions, motions, evening-analysis). For
* wider discovery, callers should use `ImfClient.sdmxFetch()` (see
* `scripts/imf-client.ts`) directly against the SDMX 3.0 endpoint, or
* invoke the `scripts/imf-fetch.ts sdmx --path ...` CLI from agentic
* workflows.
*
* @author Hack23 AB
* @license Apache-2.0
*/
import { COUNTRY_CODES, COUNTRY_NAMES_EN } from './imf-codes.js';
import { IMF_WEO_INDICATORS, IMF_FM_INDICATORS } from './imf-client.js';
// ---------------------------------------------------------------------------
// Types
// ---------------------------------------------------------------------------
/** Database family an indicator belongs to. */
export type ImfDatabase = 'WEO' | 'FM' | 'IFS' | 'BOP_AGG' | 'GFS_COFOG' | 'MFS_IR';
/** An IMF economic indicator mapped to a Swedish policy area. */
export interface ImfIndicatorContext {
/** IMF database the indicator lives in (`WEO`, `FM`, ...). */
readonly database: ImfDatabase;
/** IMF indicator code native to that database. */
readonly indicatorId: string;
/** Human-readable name (English). */
readonly name: string;
/** Concise description for article commentary. */
readonly description: string;
/** Swedish policy areas this indicator relates to. */
readonly policyAreas: readonly string[];
/** Relevant Riksdag committees. */
readonly committees: readonly string[];
/** Unit of measurement (e.g. '% of GDP', 'Annual % change'). */
readonly unit: string;
/** Whether the IMF publishes projections beyond the current year. */
readonly publishesProjections: boolean;
}
// ---------------------------------------------------------------------------
// Policy-area → IMF indicator mapping
// ---------------------------------------------------------------------------
/**
* Canonical IMF indicator catalogue used by Riksdagsmonitor article
* workflows. Only the subset actively consumed by article templates —
* extend deliberately; keep in sync with
* `analysis/economic-indicators-inventory.json`.
*/
export const IMF_INDICATORS: readonly ImfIndicatorContext[] = Object.freeze([
// --- Headline macro (FiU Finance Committee) ---
{
database: 'WEO',
indicatorId: IMF_WEO_INDICATORS.gdpGrowth,
name: 'Real GDP growth',
description:
'Year-over-year percent change in real GDP. Headline macro indicator; projected ≥ 5 years in each WEO cycle.',
policyAreas: ['fiscal policy', 'macro economy', 'growth'],
committees: ['FiU', 'SkU', 'NU'],
unit: 'Annual % change',
publishesProjections: true,
},
{
database: 'WEO',
indicatorId: IMF_WEO_INDICATORS.gdpPerCapita,
name: 'GDP per capita',
description: 'Nominal GDP per capita in current USD. Useful for cross-country peer comparisons.',
policyAreas: ['macro economy', 'living standards'],
committees: ['FiU', 'AU', 'SoU'],
unit: 'Current USD',
publishesProjections: true,
},
{
database: 'WEO',
indicatorId: IMF_WEO_INDICATORS.inflationCpi,
name: 'Inflation (CPI, average)',
description:
'Average consumer price inflation, annual % change. Primary monetary-policy reference; projected to T+5.',
policyAreas: ['monetary policy', 'inflation'],
committees: ['FiU'],
unit: 'Annual % change',
publishesProjections: true,
},
{
database: 'WEO',
indicatorId: IMF_WEO_INDICATORS.unemployment,
name: 'Unemployment rate',
description: 'Unemployment as % of total labor force, WEO definition; projected to T+5.',
policyAreas: ['labor market', 'employment'],
committees: ['AU', 'SoU'],
unit: '% of labor force',
publishesProjections: true,
},
// --- Fiscal (SkU, FiU) — critical upgrade over WB ---
{
database: 'WEO',
indicatorId: IMF_WEO_INDICATORS.generalGovGrossDebt,
name: 'General government gross debt',
description:
'Debt/GDP ratio on a general-government (EDP) basis. Superior to World Bank GC.DOD.TOTL.GD.ZS for EU policy discussion because it follows GFSM 2014.',
policyAreas: ['fiscal policy', 'debt', 'EU stability and growth pact'],
committees: ['FiU', 'SkU'],
unit: '% of GDP',
publishesProjections: true,
},
{
database: 'WEO',
indicatorId: IMF_WEO_INDICATORS.generalGovBalance,
name: 'General government net lending / borrowing',
description: 'Headline fiscal balance (surplus +, deficit −); projected to T+5.',
policyAreas: ['fiscal policy', 'budget'],
committees: ['FiU', 'SkU'],
unit: '% of GDP',
publishesProjections: true,
},
{
database: 'WEO',
indicatorId: IMF_WEO_INDICATORS.generalGovRevenue,
name: 'General government revenue',
description: 'Tax and non-tax revenue as % of GDP; projected to T+5.',
policyAreas: ['fiscal policy', 'taxation'],
committees: ['SkU', 'FiU'],
unit: '% of GDP',
publishesProjections: true,
},
{
database: 'WEO',
indicatorId: IMF_WEO_INDICATORS.generalGovExpenditure,
name: 'General government expenditure',
description: 'Total government spending as % of GDP; projected to T+5.',
policyAreas: ['fiscal policy', 'public spending'],
committees: ['FiU'],
unit: '% of GDP',
publishesProjections: true,
},
{
database: 'FM',
indicatorId: IMF_FM_INDICATORS.primaryBalance,
name: 'General government primary balance',
description: 'Fiscal balance excluding interest payments (Fiscal Monitor vintage).',
policyAreas: ['fiscal policy', 'debt sustainability'],
committees: ['FiU', 'SkU'],
unit: '% of GDP',
publishesProjections: true,
},
// --- External sector (NU, UU) ---
{
database: 'WEO',
indicatorId: IMF_WEO_INDICATORS.currentAccountBalance,
name: 'Current account balance',
description: 'Net external position (trade + primary + secondary income); projected to T+5.',
policyAreas: ['external sector', 'trade'],
committees: ['NU', 'UU', 'FiU'],
unit: '% of GDP',
publishesProjections: true,
},
{
database: 'WEO',
indicatorId: IMF_WEO_INDICATORS.exportsVolumeGrowth,
name: 'Exports volume growth',
description: 'Real exports of goods and services, annual % change.',
policyAreas: ['trade', 'export performance'],
committees: ['NU', 'UU'],
unit: 'Annual % change',
publishesProjections: true,
},
// --- Demographics (SoU) ---
{
database: 'WEO',
indicatorId: IMF_WEO_INDICATORS.population,
name: 'Population',
description: 'Total population (millions), WEO definition.',
policyAreas: ['demographics'],
committees: ['SoU', 'SfU'],
unit: 'Millions',
publishesProjections: true,
},
]);
// ---------------------------------------------------------------------------
// Lookups
// ---------------------------------------------------------------------------
/** Find indicators relevant to one or more policy domains (case-insensitive). */
export function findImfIndicatorsForDomains(
policyDomains: readonly string[],
): readonly ImfIndicatorContext[] {
if (policyDomains.length === 0) return [];
const lowered = policyDomains.map((d) => d.toLowerCase());
return IMF_INDICATORS.filter((indicator) =>
indicator.policyAreas.some((area) =>
lowered.some((q) => area.toLowerCase().includes(q) || q.includes(area.toLowerCase())),
),
);
}
/** Find indicators relevant to a Riksdag committee (e.g. 'FiU'). */
export function findImfIndicatorsForCommittee(
committee: string,
): readonly ImfIndicatorContext[] {
const upper = committee.toUpperCase();
return IMF_INDICATORS.filter((indicator) =>
indicator.committees.some((c) => c.toUpperCase() === upper),
);
}
/** Default peer-country set for Nordic + DE comparisons. */
export const IMF_NORDIC_PEERS = Object.freeze([
COUNTRY_CODES.sweden,
COUNTRY_CODES.denmark,
COUNTRY_CODES.norway,
COUNTRY_CODES.finland,
COUNTRY_CODES.germany,
] as const);
/** Look up a human-readable country name (English) by ISO-3 code. */
export function imfCountryNameEn(iso3: string): string {
return COUNTRY_NAMES_EN[iso3.toUpperCase()] ?? iso3.toUpperCase();
}
/**
* Build the `source.imf[]` citation string for an indicator. Format:
* `DATABASE:INDICATOR_ID` (e.g. `WEO:NGDP_RPCH`, `FM:GGXWDG_NGDP`).
*/
export function imfCitation(database: ImfDatabase, indicatorId: string): string {
return `${database}:${indicatorId}`;
}
|