fix(research): keep decimals intact when splitting citation claims - #278
fix(research): keep decimals intact when splitting citation claims#278vishnujayvel wants to merge 1 commit into
Conversation
The citation-graph sentence splitter treated '.' inside numbers like $62.3 as a boundary, so claim text started mid-number. Skip '.' only when flanked by digits; abbreviations remain a known limitation.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe citation graph sentence splitter now preserves decimal values. Regression tests verify complete claims, correct sentence boundaries, source-index mappings, and confidence levels for decimal-containing research synthesis text. ChangesCitation decimal handling
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks for the review, and for independently probing To restate the limitation plainly so it isn't lost if this gets revisited: abbreviations |
|
Thanks @Frankie-Xu for the careful reviews and re-verification — and for confirming the |
What & why
buildCitationGraphsplits synthesis text into claims with a regex that treats every.as a sentence boundary. Decimal amounts in the report ($62.3 billion,27.7 percent) were therefore cut mid-number, socitation_graph[].claimstarted after the decimal ("3 billion...","7 percent...") while the report body itself stayed correct.Fixes #274.
Credit: @oQAQo1 for the repro and root-cause analysis (sentence split at
digit.digitinsrc/research/citation-graph.ts).Changes
.is no longer treated as a sentence boundary, so decimal numbers stay inside the claim.e.g.,U.S.) remain a known limitation of this splitter (out of scope for this fix).Testing
npx vitest run tests/unit/research/citation-graph.test.tspasses (14 tests)npx tsc --noEmitpasses"3 billion in Q4 FY2026..."), matching the issue symptomChecklist
CONTRIBUTING.mdand agree to its contribution termsSummary by CodeRabbit
Bug Fixes
Tests