fix(research): keep decimals intact when splitting citation claims - #278
Open
vishnujayvel wants to merge 1 commit into
Open
fix(research): keep decimals intact when splitting citation claims#278vishnujayvel wants to merge 1 commit into
vishnujayvel 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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