Fact gate: no +-1 slack on integers; BNB Smart Chain hint; sample screenshot

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-16 11:10:04 -06:00
parent 85b2b7334a
commit 9e19a9ed9a
3 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -137,9 +137,8 @@ function factcheck(report, evidenceText, keyNums) {
if (!n.raw.includes('.') && !n.raw.includes(',') && v >= 1990 && v <= 2035) continue; // years
if (allowed.has(v) || allowed.has(Number(v.toFixed(2)))) continue;
// a rounded form of an allowed value (3,632 for 3,632.30, 29.06k style excluded)
let near = false;
if (v >= 100) for (const a of [v - 1, v, v + 1]) if (allowed.has(Math.round(a))) { near = true; break; }
if (!near && n.raw.includes('.')) { const d = n.raw.split('.')[1].length; for (const x of [v - Math.pow(10, -d), v + Math.pow(10, -d)]) if (allowed.has(Number(x.toFixed(d)))) near = true; }
let near = false; // integers: allowed already holds every allowed value rounded to 0 decimals (3,632 for 3,632.30)
if (n.raw.includes('.')) { const d = n.raw.split('.')[1].length; for (const x of [v - Math.pow(10, -d), v + Math.pow(10, -d)]) if (allowed.has(Number(x.toFixed(d)))) near = true; }
if (near) continue;
const i = stripped.indexOf(n.raw); bad.push({ kind: 'number', item: n.raw, context: stripped.slice(Math.max(0, i - 60), i + 40).replace(/\s+/g, ' ') });
}