Fix CodeRabbit findings from PR #34's full-diff review - #36
Merged
Conversation
Three real bugs in BuildExhaustiveAnswer/tests that were posted by
CodeRabbit before merge but not addressed in time:
- FirstOrDefault() kept only the single highest-scoring claim per
card, silently dropping other genuinely matching claims when a card
lists multiple distinct entries. Now keeps every matching claim,
ordered by segment then score; IncludedSegmentIds deduped since a
card can contribute more than one claim.
- "under" wasn't a scoring stopword, so "list every X under ledger Y"
could let an incidental single mention of "under" in an unrelated
card look rarer than the actual distinguishing identifier and wrongly
become the sole distinctive term, excluding the real target cards.
Same failure class as the earlier "every" bug.
- ContextFabricExhaustiveAnswerTests' 5-entry test only asserted a
count, not that all 5 case IDs were actually present -- wouldn't
have caught the FirstOrDefault() bug above. Tightened, plus added a
dedicated multi-claim-per-card regression test.
- ContextFabricB2TopKRagTests' big-vs-small budget test repeated the
same term three times expecting it to outscore a single mention, but
Tokenize() returns a per-segment HashSet so repetition doesn't
increase score -- the test passed without exercising the ranking
behavior it claimed to. Rewritten so "big" genuinely outranks "small"
via distinct rare terms ("batch", "inspector") "small" lacks.
Full suite: 471/0/4 (was 470/0/4; +1 new regression test).
Contributor
|
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 (3)
📝 WalkthroughWalkthroughModifies ChangesExhaustive Answer Multi-Claim Selection
Top-K RAG Test Fixture Correction
Estimated code review effort: 2 (Simple) | ~12 minutes Sequence Diagram(s)sequenceDiagram
participant Test
participant BuildExhaustiveAnswer
participant EvidenceCard
Test->>BuildExhaustiveAnswer: run question with evidence cards
BuildExhaustiveAnswer->>EvidenceCard: filter claims overlapping distinctive terms
EvidenceCard-->>BuildExhaustiveAnswer: all matching claims per card
BuildExhaustiveAnswer->>BuildExhaustiveAnswer: order by IDF score, dedupe IncludedSegmentIds
BuildExhaustiveAnswer-->>Test: answer text with all matching claims
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Summary
BuildExhaustiveAnswerusedFirstOrDefault()per card, silently dropping additional genuinely-matching claims when a card lists multiple distinct entries — now keeps every matching claim (ordered by segment then score,IncludedSegmentIdsdeduped).ContextFabricExhaustiveAnswerTestsandContextFabricB2TopKRagTests— both had weak assertions that didn't actually exercise the scenarios their comments claimed.All three were flagged by CodeRabbit's full-diff review of PR #34, posted before merge but not addressed in time.
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests