feat(energy): SPR policy classification layer (#2881)

* feat(energy): add SPR policy classification layer with 66-country registry

Static JSON registry classifying strategic petroleum reserve regimes for
66 countries (all IEA members + major producers/consumers). Integrates
into energy profile handler, shock model limitations, analyst context,
spine seeder, and CDP UI.

- scripts/data/spr-policies.json: 66-entry registry with regime, source, asOf
- scripts/seed-spr-policies.mjs: seeder following chokepoint-baselines pattern
- Proto fields 51-59 on GetCountryEnergyProfileResponse
- Handler reads SPR registry from Redis, populates proto fields
- Shock model adds fuel-mode-gated SPR limitations for non-IEA gov SPR
- Analyst context refactored to accumulator pattern (IEA + SPR parts)
- CDP UI: SPR badge for non-IEA government_spr, muted text for spare_capacity
- Spine integration: SPR fields in shockInputs + hasSprPolicy coverage flag
- Cache keys, health, bootstrap, seed-health registrations
- Tests: registry shape, ISO2, regime enum, required entries, no estimatedFillPct

* fix(energy): remove SPR from bootstrap (server-only); narrow SPR hasAny gate to renderable regimes

* feat(energy): render "no known SPR" risk note for countries with regime=none

* fix(energy): human-readable SPR regime labels; parallelize spine+registry reads in analyst
This commit is contained in:
Elie Habib
2026-04-09 22:16:24 +04:00
committed by GitHub
parent cdb73145ec
commit 1af73975b9
21 changed files with 1107 additions and 28 deletions

View File

@@ -2230,6 +2230,26 @@ components:
type: string
emberAvailable:
type: boolean
sprRegime:
type: string
description: Phase 4 — SPR policy classification
sprCapacityMb:
type: number
format: double
sprOperator:
type: string
sprIeaMember:
type: boolean
sprStockholdingModel:
type: string
sprNote:
type: string
sprSource:
type: string
sprAsOf:
type: string
sprAvailable:
type: boolean
ComputeEnergyShockScenarioRequest:
type: object
properties: