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-04-09 20:15:41 +04:00
2026-03-27 23:59:17 +04:00
2026-03-14 21:29:21 +04:00
2026-03-07 20:02:51 +04:00
2026-02-27 22:02:06 +04:00
2026-04-09 12:22:22 +04:00
2026-03-29 11:13:40 +04:00
2026-03-12 08:01:32 +04:00
2026-03-11 23:12:54 +04:00
2026-03-12 06:44:35 +04:00
2026-03-15 11:44:42 +04:00
2026-03-12 07:48:47 +04:00
2026-03-12 06:44:35 +04:00
2026-04-02 08:17:32 +04:00
2026-03-26 13:47:22 +02:00
2026-03-29 12:52:49 +04:00
2026-04-03 10:27:37 +04:00
2026-03-04 08:47:54 +04:00
2026-03-12 14:43:28 +04:00
2026-03-12 07:48:47 +04:00
2026-03-12 07:48:47 +04:00
2026-03-27 11:42:17 +04:00
2026-03-12 07:48:47 +04:00
2026-03-26 13:47:22 +02:00
2026-03-12 14:43:28 +04:00
2026-03-11 23:12:54 +04:00
2026-03-24 09:45:59 +04:00
2026-03-16 00:16:09 +04:00
2026-03-16 00:16:09 +04:00
2026-03-12 06:44:35 +04:00
2026-03-12 14:43:28 +04:00
2026-03-14 21:29:21 +04:00
2026-03-12 06:44:35 +04:00
2026-04-03 10:27:37 +04:00
2026-03-12 06:44:35 +04:00
2026-03-12 07:48:47 +04:00
2026-03-12 14:43:28 +04:00
2026-02-21 03:39:56 +04:00
2026-03-11 23:12:54 +04:00
2026-03-12 06:44:35 +04:00
2026-03-19 02:40:05 +04:00
2026-03-14 16:00:07 +04:00
2026-03-12 07:48:47 +04:00
2026-03-12 06:44:35 +04:00
2026-03-12 16:42:49 +04:00
2026-03-12 07:48:47 +04:00
2026-03-12 07:48:47 +04:00
2026-03-12 06:44:35 +04:00
2026-03-12 07:48:47 +04:00
2026-03-12 07:48:47 +04:00
2026-03-12 07:48:47 +04:00
2026-03-12 06:44:35 +04:00
2026-03-12 07:48:47 +04:00
2026-03-12 07:48:47 +04:00
2026-04-02 08:17:32 +04:00
2026-02-16 23:33:06 +04:00
2026-03-20 12:37:24 +04:00
2026-03-06 23:50:34 +04:00
2026-03-14 09:34:54 +04:00