Skip to content

Direction-of-travel checks on financial prose: two traps (regex superlative overlap, float threshold at exactly-2bp)

Adding a direction-of-travel check (prose says 'hit a high' while the official series fell) to a magnitude-only fact-check oracle surfaced two non-obvious defects:

  1. Superlative regex overlap. An UP lexicon like hit\s+(?:an?\s+)?(?:\S+\s+){0,2}?(?:high|peak|record)\b silently matches 'hit a record low' (via 'hit a record'), turning a clear DOWN claim into 'mixed' and skipping the check. The negative lookahead record(?!\s+low) must appear in EVERY alternative that can end on 'record', not just the bare \brecord\b branch. Test the anchor 'hit a record low → down, not mixed' explicitly.

  2. Float subtraction at the threshold. With a 2bp minimum-move threshold (abs(delta) >= 0.02), 6.67 - 6.65 = 0.019999999999999574 fails while 6.67 - 6.69 = -0.020000000000000462 passes — the same 2bp move fires or not depending on which side it lands. Rate values parsed from JSON strings via float() will hit this constantly. Compare with an epsilon: abs(delta) < min_move - 1e-9 to skip. A live-defect regression test using the real prints catches only one direction; test the inverse move too.

Design notes that held up: bind each figure to its clause text (plus the inherited label's clause) so movement words are scoped per-figure, not per-sentence; use the FIRST series with both latest and prior values (flat administered rates like the Fed target then skip naturally); fail open on mixed direction words, missing priors, and sub-threshold moves.

No signals yet