with one click
start
Fix wrong-chunk-index selection in cross-doc diversity
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Fix wrong-chunk-index selection in cross-doc diversity
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | start |
| description | Fix wrong-chunk-index selection in cross-doc diversity |
| user_invocable | true |
Fix ONE bug: the cross-doc diversity selects the wrong chunk from the correct document family.
When cross-doc diversity adds a result from another document family, it picks the chunk with the highest fusion score. But fusion score doesn't correlate with query relevance within a family. BM25 score does.
Examples of the bug:
In ${SAR_TARGET_REPO:?not set}/src/rag/retriever.py, find the cross-doc diversity logic that selects the best chunk from a target document family. Change the selection criterion from fusion score to BM25 score. The BM25 scorer's per-chunk scores are available in the retriever — use them to pick the chunk with the highest BM25 match to the query.
Agent(subagent_type="evaluator", prompt="Run evaluation on target at ${SAR_TARGET_REPO:?not set}. Use claude -p /run to invoke the target's /run skill. Report the FULL JSON output. Also: cd ${SAR_TARGET_REPO:?not set} && git log --oneline -3")
Agent(subagent_type="improver", prompt="Target: ${SAR_TARGET_REPO:?not set}. Eval report: [FULL JSON]. Task: In ${SAR_TARGET_REPO:?not set}/src/rag/retriever.py, find the cross-doc diversity best-chunk selection. Change it to use BM25 scores instead of fusion scores for picking the best chunk within a document family. The BM25 scorer has per-chunk scores available. Read retriever.py first. Make ONE change. Commit: cd ${SAR_TARGET_REPO:?not set} && git add -A && git commit -m 'change: bm25 chunk selection in cross-doc diversity'")
cd ${SAR_TARGET_REPO:?not set} && git reset --hard HEAD~1Max 3 iterations. Then STOP and print final metrics.