fix(context): compute require_citations gate after max_chars budget#268
fix(context): compute require_citations gate after max_chars budget#268Yurii214 wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
|
@plind-junior Hi — gentle ping on this when you have a moment. Fixes #174 — Rebased onto latest Thanks for maintaining vouch 🙏 |
the citation gate and uncited_items listed claims dropped by the max_chars budget, so a pack could fail require_citations for items the caller never received. evaluate uncited only over the returned item list. fixes vouchdev#174. Co-authored-by: Cursor <cursoragent@cursor.com>
02f4673 to
eda296b
Compare
Summary
require_citations/uncited_itemscomputation to after themax_charsbudget step inbuild_context_pack, so the quality gate only considers claims actually returned in the packuncited_items ⊆ returned ids) and the case where budget trimming removes all uncited claims before the gate runsfixes #174.
Why
before this change,
uncitedwas computed over the full pre-budget item list. tail items dropped bymax_charscould still appear inquality.uncited_itemsand trigger arequire_citationsfailure even though the caller never received those claims.Test plan
pytest tests/test_context.py -qruff check src testsmypy src(CI)Made with Cursor