fix(forecast): harden simulation keyword matching#5128
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Greptile SummaryThis PR hardens simulation bucket/channel keyword matching by replacing plain
Confidence Score: 3/5Safe to merge for the reported false-positive fixes, but silently drops coverage for compound military terms like "airstrike" via the The left-only word-boundary anchor correctly eliminates the infix false positives the PR targets. However, one-word compound forms where the keyword is not at the token start — most notably "airstrike" against the kept The matching logic in Important Files Changed
Reviews (1): Last reviewed commit: "fix(forecast): harden simulation keyword..." | Re-trigger Greptile |
Summary
Simulation bucket and channel matching now avoids broad substring hits inside unrelated words, so labels like "Corporate debt briefing" no longer satisfy the
ratekeyword and "Paramilitary procurement" no longer satisfies security escalation matching.The security-escalation channel also drops the bare
attackandmilitarykeywords, keeping the channel tied to more specific escalation signals such asmilitary action,conflict,war,strike,escalat, andgeopolit.Validation
node --test --test-name-pattern "matching helpers" tests/forecast-trace-export.test.mjsfailed before the production change on the new substring-matching regressions.node --test --test-name-pattern "matching helpers" tests/forecast-trace-export.test.mjs— 21 tests passed.node --test tests/forecast-trace-export.test.mjs— 333 tests passed.npm run typecheck./node_modules/.bin/biome lint scripts/seed-forecasts.mjs tests/forecast-trace-export.test.mjs— exit 0; reported only pre-existing informational notes outside this diff.git push -u origin HEADpre-push hook passed: frontend typecheck, API typecheck, Convex typecheck, CJS syntax, Unicode safety, architectural boundary check, safe HTML guard, rate-limit policy lint, premium-fetch parity, edge bundle check, changed test file run, and version sync.Related
Fixes #5102
Related: #5108, #5112