fix(rag): preserve text document content and source #9293
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 313 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.344
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #9293"
general
weight: 0.35
chrikrah
Related issue
Fixes #9292
Summary
When a text document dictionary supplies both
sourceandcontent, the adapter previously used the source label as the text to index. Use the provided body for chunking and keep the source as metadata. Scope the resulting IDs to the source so identical text from different sources produces distinct records.Verification
The regression exercises
RagTool.add()with the vector database client mocked. It checks the indexed body, source metadata, caller metadata, and distinct IDs for equal text from two sources. On the unmodified adapter, the new regression was the only failure (59 passed, 1 failed). With this change, all 60 tests across the four RagTool test files passed. The tests used Python 3.12.16, CrewAI and CrewAI Tools 1.15.39, and pytest 9.0.3. The adapter baseline came from upstream commit83d7407aa50b94d5b9f110c10ca295d3e0f360ee.Ruff 0.15.1 formatting and
git diff --checkpassed. Lint had one identical import-order diagnostic on both versions with the isolated workspace config. The full monorepo test suite and GitHub CI were not run.Additional context
Prepared and locally verified with Codex assistance. I do not have upstream label permissions. Maintainers, please apply the required
llm-generatedlabel during triage.<!-- CURSOR_SUMMARY -->
---
<!-- /CURSOR_SUMMARY -->