Skip to content

chore(seeders): rename ambiguous-unit realGdp field in economic:imf:growth:v1 #3837

Description

@koala73

Problem

The realGdp field stored per-country in the economic:imf:growth:v1 Redis blob is in national currency units (e.g. yen-billions for Japan, yuan-billions for China, LBP-billions for Lebanon), not USD as the unqualified name suggests. This is a footgun for any future consumer that reads the field expecting cross-country comparable USD.

Evidence

Sample values from the live Redis blob (2026-05-19):

Country realGdp (raw) Actual 2024 USD GDP ($B)
Japan 595,682 $4,250
China 126,406 $18,200
India 343,640 $3,900
Lebanon 57,918 $28
France 2,661 $3,050
Norway 5,519 $530

A naive size-comparison using this field would conclude Japan is ~150× the US and Lebanon is ~2× France — both obviously wrong.

Caught during follow-up analysis on PR #3669 (debtSustainabilityGap post-deploy verification). The PR itself is unaffected — the gap formula uses only percentage inputs (debtToGdpPct, primaryBalancePct, etc.) — but this issue tracks the latent footgun.

Proposed fix (pick one)

Option 1: Rename for unit clarity (minimal)

```diff

  • realGdp: ...
  • realGdpLcuB: ... // local-currency-unit billions
    ```
    Two-line change in scripts/seed-imf-growth.mjs. Update any consumers (grep realGdp in server/, src/, scripts/, tests/).

Option 2: Add a sibling USD field (cleanest)

Pull IMF SDMX series NGDPD (GDP at current prices, USD billions) and store as gdpUsdB alongside the existing realGdp (renamed realGdpLcuB). Three-line addition to scripts/seed-imf-growth.mjs.

Option 3: Remove realGdp entirely

Derived USD GDP can already be reconstructed from gdpPerCapitaUsd × populationMillions × 1e6 (from imfGrowth + imfLabor blobs). If no consumer needs the local-currency value, just delete the field.

Risk

Low. The field has limited usage today — grep across the codebase confirms no consumer reads it in a USD context, which is exactly why this is latent, not active. Changing it is a defensive cleanup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Standard priority, backlog or low urgency workchoreMaintenance, linting, tooling

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions