fix(simulation): expand CHANNEL_KEYWORDS bridge terms for geopolitical scenario language (#2419)

risk_off_rotation: add sovereign risk, shockwave, contagion, spiral, crisis
energy_supply_shock: add oil infrastructure, supply disruption, oil price spike, crude price
shipping_cost_shock: add rerouting, vessel, shipping lane, maritime

LLM simulation output uses geopolitical scenario text that previously missed
financial keyword matching. Bridge terms connect scenario labels to channels.

Tests: 3 new matchesChannel bridge keyword tests (227 pass)
This commit is contained in:
Elie Habib
2026-03-28 15:04:34 +04:00
committed by GitHub
parent 81d773d2bb
commit 2430fa8500
2 changed files with 19 additions and 3 deletions

View File

@@ -6509,6 +6509,22 @@ describe('phase 3 simulation re-ingestion — matching helpers', () => {
assert.ok(matchesChannel({ label: 'Crude supply disruption energy', summary: '' }, 'energy_supply_shock'));
});
it('matchesChannel energy_supply_shock matches oil infrastructure scenario (bridge keyword)', () => {
assert.ok(matchesChannel({ label: 'Oil infrastructure damage leads to supply disruption', summary: '' }, 'energy_supply_shock'));
assert.ok(matchesChannel({ label: 'Crude price spike from Persian Gulf closure', summary: '' }, 'energy_supply_shock'));
});
it('matchesChannel shipping_cost_shock matches maritime rerouting scenario (bridge keyword)', () => {
assert.ok(matchesChannel({ label: 'Tanker rerouting via Cape of Good Hope raises freight costs', summary: '' }, 'shipping_cost_shock'));
assert.ok(matchesChannel({ label: 'Vessel traffic diverted from Suez Canal shipping lane', summary: '' }, 'shipping_cost_shock'));
});
it('matchesChannel risk_off_rotation matches geopolitical sovereign risk scenario (bridge keyword)', () => {
assert.ok(matchesChannel({ label: 'Regional Conflict & Sovereign Risk Spiral', summary: 'rapid repricing of sovereign risk' }, 'risk_off_rotation'));
assert.ok(matchesChannel({ label: 'Global Economic Shockwave', summary: '' }, 'risk_off_rotation'));
assert.ok(matchesChannel({ label: 'Market contagion from India FX crisis', summary: '' }, 'risk_off_rotation'));
});
it('matchesChannel returns false for unrelated text', () => {
assert.ok(!matchesChannel({ label: 'Political talks', summary: 'Ceasefire' }, 'shipping_cost_shock'));
});