Elie Habib
bd07829518
feat(supply-chain): Sprint 2 — bypass corridor intelligence + cost shock engine (#2873)
* feat(supply-chain): Sprint 2 — bypass corridor intelligence + cost shock engine
- src/config/bypass-corridors.ts: ~40 bypass corridors for all 13 chokepoints
- server/supply-chain/v1/get-bypass-options.ts: PRO-gated RPC, live bypass scoring from chokepoint status cache
- server/supply-chain/v1/get-country-cost-shock.ts: PRO-gated RPC, war risk premium BPS + energy coverage days (HS 27)
- server/supply-chain/v1/_insurance-tier.ts: pure function, Lloyd's JWC threat → premium BPS
- gateway.ts + premium-paths.ts: registered both RPCs as slow-browser + PRO-gated
- src/services/supply-chain/index.ts: fetchBypassOptions + fetchCountryCostShock client methods
- proto: GetBypassOptions + GetCountryCostShock messages + service registrations
- tests/supply-chain-sprint2.test.mjs: 61 tests covering all new components
Co-Authored-By: Claude Sonnet 4.6 (200K context) <noreply@anthropic.com>
* fix(cost-shock): call computeEnergyShockScenario directly instead of reading wrong cache key
The old code read from `energy:shock:${iso2}:${chokepointId}:v1` which never
matches the actual v2 cache key written by compute-energy-shock.ts. Fix by
calling computeEnergyShockScenario() directly (it handles v2 caching internally)
and mapping effectiveCoverDays + crude product deficitPct to the response fields.
* fix(cost-shock): average refined product deficitPct instead of looking for non-existent 'crude' product
---------
Co-authored-by: Claude Sonnet 4.6 (200K context) <noreply@anthropic.com>
2026-04-09 20:15:41 +04:00
..
2026-03-28 23:07:18 +04:00
2026-03-28 23:07:18 +04:00
2026-04-04 23:18:53 +04:00
2026-04-04 23:18:53 +04:00
2026-03-15 01:42:04 +04:00
2026-03-15 01:42:04 +04:00
2026-03-20 17:08:22 +04:00
2026-03-20 17:08:22 +04:00
2026-02-27 19:44:40 +04:00
2026-02-27 19:44:40 +04:00
2026-02-27 19:44:40 +04:00
2026-02-27 19:44:40 +04:00
2026-04-06 16:28:04 +04:00
2026-04-06 16:28:04 +04:00
2026-03-29 23:03:03 +04:00
2026-03-29 23:03:03 +04:00
2026-03-21 12:24:59 +04:00
2026-03-21 12:24:59 +04:00
2026-04-03 10:27:37 +04:00
2026-04-03 10:27:37 +04:00
2026-03-15 01:42:04 +04:00
2026-03-15 01:42:04 +04:00
2026-03-22 22:58:41 +04:00
2026-03-22 22:58:41 +04:00
2026-04-09 12:40:13 +04:00
2026-04-09 12:40:13 +04:00
2026-02-27 19:44:40 +04:00
2026-02-27 19:44:40 +04:00
2026-03-27 09:13:51 +04:00
2026-03-27 09:13:51 +04:00
2026-03-26 17:50:37 +04:00
2026-03-26 17:50:37 +04:00
2026-03-10 07:23:07 +04:00
2026-03-10 07:23:07 +04:00
2026-04-02 21:16:35 +04:00
2026-04-02 21:16:35 +04:00
2026-02-27 19:44:40 +04:00
2026-02-27 19:44:40 +04:00
2026-03-15 01:42:04 +04:00
2026-03-15 01:42:04 +04:00
2026-03-17 09:18:06 +04:00
2026-03-17 09:18:06 +04:00
2026-02-27 19:44:40 +04:00
2026-02-27 19:44:40 +04:00
2026-04-09 12:22:46 +04:00
2026-04-09 12:22:46 +04:00
2026-03-23 19:38:11 +04:00
2026-03-23 19:38:11 +04:00
2026-03-27 22:33:45 +04:00
2026-03-27 22:33:45 +04:00
2026-04-09 20:15:41 +04:00
2026-04-09 20:15:41 +04:00
2026-03-17 14:24:26 +04:00
2026-03-17 14:24:26 +04:00
2026-03-23 19:52:56 +04:00
2026-03-23 19:52:56 +04:00
2026-02-27 19:44:40 +04:00
2026-02-27 19:44:40 +04:00
2026-03-15 01:42:04 +04:00
2026-03-15 01:42:04 +04:00
2026-04-09 09:01:56 +04:00
2026-04-09 09:01:56 +04:00